Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Name Verification
I have a userform that creates a new worksheet, enters data from the form,
and performs calculations based on that data. One of the entries on the form is an ID which becomes the name of the new worksheet. How can I check the names of all the worksheets (indefinite number of sheets) to verify the new ID isn't a duplicate and stop the program from running? The desired result is to prompt the user for a new name and then run the procedure. I tried an If...Then...Else statement, but it's renaming and overwriting the original and still creating a new blank sheet. I hope I haven't confused you! Thanks! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Name Verification
assume id is in myVar
On Error Resume Next Set sh = worksheets(myVar) On Error Goto 0 If sh Is Nothing Then Worksheets.Add.name = myVar End If -- HTH Bob Phillips "MAWII" wrote in message ... I have a userform that creates a new worksheet, enters data from the form, and performs calculations based on that data. One of the entries on the form is an ID which becomes the name of the new worksheet. How can I check the names of all the worksheets (indefinite number of sheets) to verify the new ID isn't a duplicate and stop the program from running? The desired result is to prompt the user for a new name and then run the procedure. I tried an If...Then...Else statement, but it's renaming and overwriting the original and still creating a new blank sheet. I hope I haven't confused you! Thanks! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Pop up verification when opening a sheet. | Excel Worksheet Functions | |||
cell verification | Excel Discussion (Misc queries) | |||
Date verification | Excel Discussion (Misc queries) | |||
data verification | Excel Discussion (Misc queries) | |||
Licence Verification | Excel Programming |