-
Hi.
See if this could help you:
Put the code below into a standard module then link it to a button, as you said
[vba]Sub ActivateSheet()
Dim sh As Worksheet
For Each sh In Worksheets
If sh.Name Like ActiveCell.Value Then
sh.Activate
Exit For
End If
Next sh
End Sub[/vba]
Other way, you may want to do the same job without using a button, so put the code bellow into the sheet module, this way:
1. copy the code from the board
2. right clique the sheet tab and choose 'View code'
3. paste the code into the blank panel that will open
4. done! 'Alt+Q' to go back to sheet and test
note - this code will be triggered as the user choose a sheet name from the drop down list; it will act only if drop down list is in column 3 (column C), change it to suit
[vba]Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count > 1 Or Target.Column <> 3 Then Exit Sub
Dim sh As Worksheet
For Each sh In Worksheets
If sh.Name Like Target.Value Then
sh.Activate
Exit For
End If
Next sh
End Sub[/vba]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules