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

Is there a way for coding in a macro to update if, for example, a worksheet
that it refers to is renamed? Here is a portion of a macro I use:
Workbooks.Open Filename:="U:\NTHEA\2009-10\OPER INVEST\BAYERI.xls",
Notify:=False
Sheets("bal").Activate

In this case, the "bal" sometimes gets renamed to something else, by another
user. That is, the other user changes or renames their worksheet and does
not tell me. Therefore my macro does not work.

So, is there a way for that name "bal" to change automaticallly if/when the
other user changes the name?

Thank you

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default Macro coding

What you need to do is use the Worksheet code name

http://www.ozgrid.com/VBA/excel-vba-sheet-names.htm

Code named get a bit tricky if you aren't referencing them in the active
workbook. If you have questions about that, come back.

HTH,
Barb Reinhardt

"Flipper" wrote:

Is there a way for coding in a macro to update if, for example, a worksheet
that it refers to is renamed? Here is a portion of a macro I use:
Workbooks.Open Filename:="U:\NTHEA\2009-10\OPER INVEST\BAYERI.xls",
Notify:=False
Sheets("bal").Activate

In this case, the "bal" sometimes gets renamed to something else, by another
user. That is, the other user changes or renames their worksheet and does
not tell me. Therefore my macro does not work.

So, is there a way for that name "bal" to change automaticallly if/when the
other user changes the name?

Thank you

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 298
Default Macro coding

Is there some other way you can identify the sheet (eg. by its content?)

Tim


"Flipper" wrote in message
...
Is there a way for coding in a macro to update if, for example, a
worksheet
that it refers to is renamed? Here is a portion of a macro I use:
Workbooks.Open Filename:="U:\NTHEA\2009-10\OPER INVEST\BAYERI.xls",
Notify:=False
Sheets("bal").Activate

In this case, the "bal" sometimes gets renamed to something else, by
another
user. That is, the other user changes or renames their worksheet and does
not tell me. Therefore my macro does not work.

So, is there a way for that name "bal" to change automaticallly if/when
the
other user changes the name?

Thank you



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
HELP - coding on Macro! Eric Excel Worksheet Functions 3 February 21st 08 12:26 AM
Macro coding using GIF kami Excel Programming 1 October 13th 07 10:57 PM
Implant macro coding into ASP coding Sam yong Excel Programming 5 September 15th 05 10:37 AM
Help please with coding a macro useR Excel Programming 3 August 8th 05 09:02 PM
Need VB Coding Help for a Macro Tom Ogilvy Excel Programming 0 August 26th 04 08:46 PM


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