Checking for valid worksheet in macro
Posted by Eli Weiss on February 12, 2002 11:56 PM
I have a macro which prompts the user to enter a name of the worksheet he wants to update in his workbook.
The code for this is :
WorksheetName = inputBox(Enter name of Worksheet)
My problem is how to force the user to enter a correct name of one of the worksheets that is in that workbook.
In other words I want to check the input and stop the macro or alert the user, if his input is wrong.
Any help will be appreciated.