Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
sparky
 
Posts: n/a
Default Rules for Sheet names

I am creating workbooks through a programmatic interface and need to know
what constraints there are on worksheet names. I understand that they have to
be no more than 31 (or 32?) characters in length, but are there other rules
like allowable characters that I need to be aware of?
  #3   Report Post  
Gord Dibben
 
Posts: n/a
Default

sparky

31 characters max.

Cannot use any of these \ / ? * [ ]


Gord Dibben Excel MVP

On Tue, 11 Jan 2005 15:15:03 -0800, sparky
wrote:

I am creating workbooks through a programmatic interface and need to know
what constraints there are on worksheet names. I understand that they have to
be no more than 31 (or 32?) characters in length, but are there other rules
like allowable characters that I need to be aware of?


  #4   Report Post  
Dave Peterson
 
Posts: n/a
Default

I'm guessing that you're going to validate a user's input so that you can rename
a sheet.

If that's close, then I just accept their input and try to rename and then check
for errors.

dim MyNewName as string
mynewname = inputbox(prompt:="what's the new name")
if mynewname = "" then
exit sub 'or whatever
end if

on error resume next
activesheet.name = mynewname
if err.number < 0 then
msgbox "invalid name--not renamed"
err.clear
end if
on error goto 0

=====
There are some other rules--can't use "history" as a name (used with tracking
changes)

And you can't use a name that's alread in use in that workbook.



sparky wrote:

I am creating workbooks through a programmatic interface and need to know
what constraints there are on worksheet names. I understand that they have to
be no more than 31 (or 32?) characters in length, but are there other rules
like allowable characters that I need to be aware of?


--

Dave Peterson
  #5   Report Post  
Dana DeLouis
 
Posts: n/a
Default

Be aware of the "!" character also. You may have an error when using [...]
addressing.
For example, you can name a sheet with this character. For example
"Sheet!2"

This works...
[Sheet1].Select

But this would not work...
[Sheet!2].Select

HTH
--
Dana DeLouis
Win XP & Office 2003


"sparky" wrote in message
...
I am creating workbooks through a programmatic interface and need to know
what constraints there are on worksheet names. I understand that they have
to
be no more than 31 (or 32?) characters in length, but are there other
rules
like allowable characters that I need to be aware of?



Reply
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
Setting up a random list from long list of names ? yorkshire exile Excel Discussion (Misc queries) 4 January 6th 05 01:44 PM
How do I compare two lists of names in excel? Jack the Cate Excel Discussion (Misc queries) 1 December 24th 04 12:07 PM
How can I find the common names in two columns of names? hako Excel Discussion (Misc queries) 2 December 8th 04 01:59 AM
source data names Yeliz Excel Discussion (Misc queries) 1 December 2nd 04 01:23 PM
How do I put a list of names and e-mail addresses in excel so tha. trav Excel Discussion (Misc queries) 4 December 2nd 04 02:56 AM


All times are GMT +1. The time now is 01:46 PM.

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"