LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to compare two columns of Names Sharon Excel Discussion (Misc queries) 5 January 30th 09 11:04 PM
Compare Worksheet Names - Ignore Case? Trader_in_Paradise Excel Programming 3 May 12th 07 12:31 AM
Compare two lists of names ea Excel Discussion (Misc queries) 1 December 22nd 05 01:31 AM
Excel Worksheet Subtotals Data Truncate tomwashere2 Excel Programming 1 June 16th 05 02:12 AM
Compare names in two different worksheets excelnewbie Excel Programming 2 September 15th 03 08:59 PM


All times are GMT +1. The time now is 02:27 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"