Paul Hesketh
Paul Hesketh

Reputation: 95

Excel Hyperlinks and VBA

I have a Data Validation list

enter image description here

which refer to my various worksheets

enter image description here

I would like to be able to select the worksheet I wish to view / jump to and use a VBA button to take me to that worksheet.

Is this possible please?

PS: I would like a single button to go to the sheet selected from the dropdown

Upvotes: 0

Views: 75

Answers (1)

user6432984
user6432984

Reputation:

In the VBA Project window double click the Worksheet that has your validation list. This will open the that Worksheet's code module. Paste this code and change Range("E1") to the correct cell address.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

    If Not Intersect(Taget, Range("E1")) Is Nothing Then
        On Error Resume Next
            Sheets(Range("E1").Text).Select
        On Error GoTo 0
    End If

End Sub

enter image description here

Upvotes: 1

Related Questions