none
Google sheet RRS feed

  • Question

  • Hi, 

    I would like to know if we can do a dropdown list of a hyperlink that can take you to a tab in specific on google sheet.

    Wednesday, February 14, 2018 1:16 AM

All replies

  • Hi Bemb11,

    You had mentioned that,"I would like to know if we can do a dropdown list of a hyperlink that can take you to a tab in specific on google sheet."

    Try to refer example below may help you.

    Code:

    Private Sub ComboBox1_Change()
        Dim rng As Range
        Dim str As String
            Set rng = Sheets(1).Range("A1")
            str = Me.ComboBox1.Value
                With Worksheets(1)
                    .Hyperlinks.Add Anchor:=.Range("A1"), _
                    Address:=str, _
                    ScreenTip:=str, _
                    TextToDisplay:=str
                End With
                rng.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True
                rng.Clear
    End Sub
    
    Private Sub CommandButton1_Click()
        Me.ComboBox1.AddItem (Me.TextBox1.Value)
    End Sub
    
    Private Sub CommandButton2_Click()
        Me.ComboBox1.Clear
    End Sub

    Output:

    Regards

    Deepak


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, February 15, 2018 7:39 AM
    Moderator