T
Trader_in_Paradise
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?
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?