Hello - I have the code below and would like the dialog box to take the value of the current selected cell.
Example: cell A1 (selected, active) says "Price Sheet Client 1" that sheet name ("Price Sheet Client 1") would auto fill into the pop up box and then the user can just hit OK to go to that sheet.
Or is there a better way to do this via VBA? My goal is that from a list of sheet names on Sheet 1 - the user can easily jump to the corresponding sheet.
Sub GetSheet()
Dim SearchData As String
SearchData = InputBox("Enter the Client Name.")
If SearchData <> vbNullString Then
On Error Resume Next
Sheets(SearchData).Activate
If Err.Number <> 0 Then MsgBox "Unable to find sheet named: " & SearchData
On Error GoTo 0
End If
End Sub
Thanks for your help.
Example: cell A1 (selected, active) says "Price Sheet Client 1" that sheet name ("Price Sheet Client 1") would auto fill into the pop up box and then the user can just hit OK to go to that sheet.
Or is there a better way to do this via VBA? My goal is that from a list of sheet names on Sheet 1 - the user can easily jump to the corresponding sheet.
Sub GetSheet()
Dim SearchData As String
SearchData = InputBox("Enter the Client Name.")
If SearchData <> vbNullString Then
On Error Resume Next
Sheets(SearchData).Activate
If Err.Number <> 0 Then MsgBox "Unable to find sheet named: " & SearchData
On Error GoTo 0
End If
End Sub
Thanks for your help.