Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Compare Worksheet Names - Truncate?
Private Sub btnRenameE_Click()
Dim MyName As String Dim MySheet As Object Set MySheet = ActiveWorkbook.ActiveSheet Dim Sheet As Object On Error GoTo btnRename_Err: NamingRoutine: ' Input box to capture User's Input for Worksheet Name MyName = Application.InputBox("What would you like to name this Sheet?", "Your Name for this Sheet") ' Now test for reserved names, Options, Dates or Scratch ElseIf MyName = "Options" Or MyName = "Dates" Or MyName = "Scratch" Then MsgBox "The names, Options, Dates and Scratch are in use. Please Choose another name for this Worksheet", , "This Name is Reserved." GoTo NamingRoutine: This Code Fails if MyName contains the string "Options" or "Date" or "Scratch" For Example, if MyName = someDate or Options1, the code loops to NamingRoutine. Is there a truncate or exact function? Any other suggestions? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to compare two columns of Names | Excel Discussion (Misc queries) | |||
Compare Worksheet Names - Ignore Case? | Excel Programming | |||
Compare two lists of names | Excel Discussion (Misc queries) | |||
Excel Worksheet Subtotals Data Truncate | Excel Programming | |||
Compare names in two different worksheets | Excel Programming |