Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
If I select a sheet with its real name:
Sheets("Sheet1").Select - Works fine Sheets(Array("Sheet1", "Sheet2")).Select - Works fine If I assign the sheet name(s) to a constant Public Const TSGSheet1 = "Sheet1" Public Const TSGSheet2 = "Sheet2" Sheets(TSGSheet1).Select - Works fine Sheets(TSGSheet2).Select - Works fine Sheets(Array(TSGSheet1, TSGSheet2)).Select - fails with Error 1004 My macro's/VBA do multiple Selects and rather than explicitly specifying the sheet names in every command, I thought I would set up a constant, use the constant in the multiple commands. If I then wanted to change the sheet name, I could just change the constant assignment once. Have I done something wrong? It would appear that you can not use constants in an array? -- Trefor |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
is it possible to select and change the values of cells in a minimized excel spread sheet from vba? | Excel Worksheet Functions | |||
Formula checking multiple worksheets | Excel Worksheet Functions | |||
Formula checking multiple worksheets | Excel Worksheet Functions | |||
Dynamic Formulas with Dynamic Ranges | Excel Worksheet Functions | |||
how can i select all the cells with same color on a sheet if there are multipale colors by vba code | Charts and Charting in Excel |