Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Absolute Worksheet References
Hi there,
I read that (O'Reilly Excel Hacks, page 192) if you use "absolute" Worksheet references that if the actual worksheet name changes that the application will continue to work. This is true but I am using Excel 2003 and keep getting a reference not valid message, although the macro still appears to work. Is there any way to fix this so that the message does not appear? To make myself clear: Normally to reference a worksheet you can use: 1) dim wks as Excel.Worksheet set wks = ThisWorkbook.Worksheets("Sheet1") OR 2) dim wks as Excel.Worksheet set wks = ThisWorkbook.Worksheets(1) However, if you change Sheet1 to another name, (1) above breaks. If you change the worksheet position within the workbook, (2) above breaks. However you are supposedly able to just reference a sheet by the name given to it in the properties window. So looking in your Project Explorer under Microsoft Excel Objects if you use the Codename of the worksheet rather than the name you have given it (i.e. Sheet1, etc.) you can reference the sheet directly without going through the above, wiht the added benefit of it being (supposedly) impervious to worksheet name changes... Except that it gives you this annoying Reference not valid message. Any help on getting the message to go away? Regards, Ric |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
convert relative cell references to absolute cell references via amacro? | Excel Discussion (Misc queries) | |||
Help with converting a block of cells with Absolute and mixed references to relative references | Excel Worksheet Functions | |||
Absolute References | Excel Discussion (Misc queries) | |||
Absolute References | Excel Worksheet Functions | |||
Absolute references | Excel Programming |