View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Nigel Nigel is offline
external usenet poster
 
Posts: 923
Default Track Sheet Name Changes... Help!

Hi,
I am not sure of the logic here?

You can still use codenames in all situations, if the very hidden sheet
contains a list of the special sheets, presumably these already exist, in
which case codenames will work. If the user adds a new sheet, use the
Workbook_NewSheet event to trigger the code to store/change the codename in
your tracking sheet.

In all cases you have a controlled set of codenames for all sheets.

Now if the user deletes a sheet, presumably this is acceptable, you
application will need to track the codename has having being deleted.

Cheers
Nigel



"T-容x" wrote in message
...

Yes, you're right... I am concerned w/ the user changing the sheet tab
name.
I know I can refer to the sheets using their codenames in VBA.
Unfortunately, that won't work in my situation as users may add/delete
sheet(s).

In the prog I'm making, there are "special" sheets that I have to keep
track of. The names of these sheets are stored in a hidden
(xlVeryHidden) sheet. The prob is when users change the tab names, the
original tab names stored in the hidden sheet would now NOT coincide
with the new names.

My first approach to remedy this was to protect the workbook and only
allow the users to change the tab names using a custom form and code.
The problem is, other actions that are normally allowed in an
unprotected workbook are now disabled, e.g. rearranging sheets, etc...
My code is getting more and more complex and I think protecting the
workbook is not a very good idea... :(

Nigel Wrote:
I suspect you are concerned with the user changing the sheet tab name
that
maybe used in your code? I always use the codename for the worksheet,
that
way the user can change tabs and it does not affect the code. You can
only
set the codename in the VBA editor or through VBA code itself.

If this is not the problem, then the only way I can think of, is to
store
the sheet name on each sheet (perhpas a hidden location) and test the
current name against that ?

--
Cheers
Nigel



"T-容x" wrote in
message
...

Hi! Is there an event or a way to determine if a sheet's name has

been
changed by the user?


--
T-容x

------------------------------------------------------------------------
T-容x's Profile:

http://www.excelforum.com/member.php...o&userid=26572
View this thread:

http://www.excelforum.com/showthread...hreadid=399687



--
T-容x
------------------------------------------------------------------------
T-容x's Profile:

http://www.excelforum.com/member.php...o&userid=26572
View this thread: http://www.excelforum.com/showthread...hreadid=399687