View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Umlas, Excel MVP Bob Umlas, Excel MVP is offline
external usenet poster
 
Posts: 320
Default Worksheet name in Macro

Use the Set statement:
Set CurrSheet = ActiveSheet (or set CurrSheet = Sheets("HERMAN")
Then you can use
CurrSheet.Name = "WAMMER"
and still refer to Currsheet instead of Sheets("Herman") or Sheets("WAMMER")
eg: CurrSheet.Range("G5").Value = 22
will change the G5 to 22 no matter what its name is.

"wammer " wrote:

How can I make it so that the worksheet names references in a macro will
change as I change the worksheet name?

Thanks
Cam


---
Message posted from http://www.ExcelForum.com/