One option, using a Data Validation drop-down list in a cell. The code below should go into the ThisWorkbook module and will run when the workbook is opened. It will update the data validation list in Sheet1 cell A2 with the current list of worksheet names.
Private Sub Workbook_Open()
Dim str As String, ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
str = str & ws.Name & ","
Next ws
With Sheets("Sheet1").Range("A2").Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:=str
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = "Invalid Sheet"
.InputMessage = ""
.ErrorMessage = "Don't type here, just select a sheet name from the list."
.ShowInput = True
.ShowError = True
End With
End Sub
When you select a sheet name from the drop-down list, the code shown below - which should go into the Sheet module for the sheet containing the data validation list - will activate the chosen sheet.
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("A2")) Is Nothing Then Sheets(Range("A2").Value).Activate
End Sub
Bookmarks