Consulting

Results 1 to 4 of 4

Thread: Solved: Forms with hyperlinks

  1. #1

    Smile Solved: Forms with hyperlinks

    I am currently working on making a form to pull back data in excel

    I have a list of data , which can be anything from 100 rows to 40000 rows depending on the site I am working on , I need this form to allow the user to input the agent_ID and the click run, this will then populate the form with the first 5 calls for that agent.

    the form must show in the following order

    Unquie ID
    Agent ID
    Date
    Time
    Audit
    Call Lenght
    Call Link (hyperlink)

    i have attached dummy data

  2. #2

    Update .. help with code

    Private Sub Cmd_AgentPin_Search_Click()
     
        If Sheets("Call_List").AutoFilterMode = True Then Sheets("Call_List").AutoFilterMode = False
        Names.Add Name:="Filter_Area", RefersToR1C1:="=Call_List!R1C1:R65536C10"
        
        With Range("Filter_Area").Resize(, 10)
            .AutoFilter Field:=4, Criteria1:=Me.txt_AgentPin.Value
        End With
        
        Sheets("Data").Cells.ClearContents
        
        Sheets("Call_List").Range("A1").CurrentRegion.Copy
        Sheets("Data").Select
        Range("a1").Select
        ActiveSheet.Paste
        
        Me.txt_Call1_Link.Value = ThisWorkbook.Sheets("Data").Range("I2").Value
        Me.txt_Call2_Link.Value = ThisWorkbook.Sheets("Data").Range("I3").Value
    End Sub
    Private Sub Cmd_Call1_Play_Click()
    Link = Me.txt_Call1_Link.Value
    'On Error GoTo NoCanDo
    ActiveWorkbook.FollowHyperlink Address:=Link, NewWindow:=True
    Unload Me
    'Exit Sub
    'NoCanDo:
    'MsgBox "Cannot open " & Link
    End Sub
    Private Sub Cmd_Call2_Play_Click()
    Link = Me.txt_Call2_Link.Value
    'On Error GoTo NoCanDo
    ActiveWorkbook.FollowHyperlink Address:=Link, NewWindow:=True
    Unload Me
    'Exit Sub
    'NoCanDo:
    'MsgBox "Cannot open " & Link
    
    End Sub

    this code works fine until Private Sub Cmd_Call1_Play_Click or Private Sub Cmd_Call2_Play_Click. When I click the play button, it closes the user form and opens the link, i need the user form to always stay visible.

    Can anyone help

  3. #3
    VBAX Mentor tpoynton's Avatar
    Joined
    Feb 2005
    Location
    Clinton, MA
    Posts
    399
    Location
    Unload Me closes the userform

  4. #4

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •