I do this with a "menu" sheet and the other sheet names typed in. Then right
click on the cell with the name.
Right click sheet tab>view code>insert this
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
Application.DisplayAlerts = False
Dim WantedSheet As String
WantedSheet = Trim(ActiveCell.Value)
If WantedSheet = "" Then Exit Sub
On Error Resume Next
If Sheets(WantedSheet) Is Nothing Then
' GetWorkbook ' calls another macro to do that
Else
Application.GoTo Sheets(WantedSheet).Range("a1")
End If
Application.DisplayAlerts = True
End Sub
I do this with a "menu" sheet and the other sheet names typed in. Then right
click on the cell with the name.
Right click sheet tab>view code>insert this
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
Application.DisplayAlerts = False
Dim WantedSheet As String
WantedSheet = Trim(ActiveCell.Value)
If WantedSheet = "" Then Exit Sub
On Error Resume Next
If Sheets(WantedSheet) Is Nothing Then
' GetWorkbook ' calls another macro to do that
Else
Application.GoTo Sheets(WantedSheet).Range("a1")
End If
Application.DisplayAlerts = True
End Sub
Can I use Form Buttons on this Page instead of cells?
No, not with the code Don has supplied.
If you use Form buttons, you would need separate macros which you would have
to assign to each button with something like
Sub SelectSht1()
Sheets("Accounts 08").Activate
End Sub
Alternatively, you could use Hyperlinks
With Sheet name in a cell>Right click>Insert>Hyperlink>Link to>Place in this
Document>choose Sheet location>Enter a cell Reference
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.