Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Like operator
I am trying to write vba code so a user can enter a worksheet name using an
inputbox. The worksheets are named by the client name. e.g. "Smith, Adam" and I would like the user to be able to put in the name "Smith" and have the correct worksheet selected, or a range of worksheets if there are more than 1 "Smith". How can I write this. The code I have written so far is: Private Sub Workbook_Open() On Error GoTo ErrorHandler Dim stclname As String Dim stermes As String Enterclname: stclname = InputBox("Enter the Client Name") Worksheets(stclname).Activate Exit_Workbook_Open: Exit Sub ErrorHandler: stermes = MsgBox("Check the spelling") Resume Enterclname End Sub Thanks in advance |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Operator for Contains | Excel Worksheet Functions | |||
Operator | Excel Worksheet Functions | |||
IN operator | Excel Worksheet Functions | |||
Mod operator | Excel Programming | |||
Can the AND operator be of use here? | Excel Programming |