Compare Worksheet Names - Truncate?
"Vergel Adriano" wrote:
Trader,
If MyName=someDate or MyName = Options1, the code should ask for a new name,
right? Try something like this:
If InStr(1, MyName, "Options", vbTextCompare) 0 Or _
InStr(1, MyName, "Dates", vbTextCompare) 0 Or _
InStr(1, MyName, "Scratch", vbTextCompare) 0 Then
MsgBox "The names, Options, Dates and Scratch are in use. Please
Choose another name for this Worksheet", , "This Name is Reserved."
GoTo NamingRoutine:
End If
--
Hope that helps.
Vergel Adriano
I did not explain the problem correctly.
I wish to reserve the exact names "Options", "Dates" and "Scratch"
Any deviation from these names, except simply capitalization, is acceptable.
For Example: OPTIONS is not acceptable, nor is dates or SCratch.
However, Options1 or OptionsJun or DateMay are names that I would expect and
these names are acceptable.
Thank you.
|