create msg box

A

Anthony

Hi,
Can anybody offer some code (as I'm new to this) to alow the user to input a
name into a msg box and then search and display the corrct worksheet with
that name.
I thank you!
 
T

Trevor Shuttleworth

Anthony

one way:

Sub ActivateSheet()
Dim sSheetName As String
sSheetName = InputBox("Input Sheet Name", "Sheet Name", "Sheet1")
If sSheetName = "" Then Exit Sub
On Error Resume Next
Sheets(sSheetName).Select
On Error GoTo 0
End Sub

Regards

Trevor
 
A

Anthony

thanks Trevor - I'll give that a try

Trevor Shuttleworth said:
Anthony

one way:

Sub ActivateSheet()
Dim sSheetName As String
sSheetName = InputBox("Input Sheet Name", "Sheet Name", "Sheet1")
If sSheetName = "" Then Exit Sub
On Error Resume Next
Sheets(sSheetName).Select
On Error GoTo 0
End Sub

Regards

Trevor
 
Top