Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default Worksheet name

Anybody know some event code I could use to execute should a user try to
change the name of a worksheet? I wrote a macro that won't work if it gets
lost in the workbook (if someone changes the worksheet names) so I want to
somehow protect the current names. I tried worksheet_change, but that only
seems to execute if a cell in the worksheet is changed. Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Worksheet name

If you protect the Workbook (structure option as a minimum) then the user
won't be able to rename, delete, add or change the order of sheets.

--
Regards,
Tom Ogilvy


"xlcharlie" wrote in message
...
Anybody know some event code I could use to execute should a user try to
change the name of a worksheet? I wrote a macro that won't work if it

gets
lost in the workbook (if someone changes the worksheet names) so I want to
somehow protect the current names. I tried worksheet_change, but that

only
seems to execute if a cell in the worksheet is changed. Thanks.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 770
Default Worksheet name

You could also use the code name of the worksheet. It's shown in the
Project Explorer to the left of the tab name (the one displayed on your
worksheet) and in the Name property of the Properties window for the sheet.
Originally both the tab and the code name are the same, e.g., "Sheet1." You
can change the code name in the Name property in the Properties Window. It
doesn't change if users change the tab name. Use the code name like this:

Sheet1.Range("A1") = "test"

For more info see VBA help for "CodeName Property."

hth,

Doug Glancy

"xlcharlie" wrote in message
...
Anybody know some event code I could use to execute should a user try to
change the name of a worksheet? I wrote a macro that won't work if it

gets
lost in the workbook (if someone changes the worksheet names) so I want to
somehow protect the current names. I tried worksheet_change, but that

only
seems to execute if a cell in the worksheet is changed. Thanks.



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
automatically appending newly added data on worksheet to a master list worksheet tabylee via OfficeKB.com Links and Linking in Excel 0 December 17th 09 04:24 PM
Unable to Insert Worksheet/Move and copy worksheet Excel 2003 lukerush Excel Worksheet Functions 2 September 7th 06 05:05 PM
Upload multiple text files into 1 excel worksheet + put the filename as the first column in the worksheet Aster Excel Worksheet Functions 3 March 12th 06 09:58 AM
I want in one worksheet to relatively link to/reference cells in another without changing the format of the current worksheet. [email protected] Excel Discussion (Misc queries) 0 September 22nd 05 04:39 PM
Attaching a JET database to an Excel Worksheet OR storing large binary data in a worksheet Ant Waters Excel Programming 1 September 3rd 03 11:34 AM


All times are GMT +1. The time now is 01:53 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"