Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Control on different sheet than the executable
I need to replace ActiveSheet with the sheet name but I want the user to be
able to change the worksheet name without messing up the macro. Any suggestions? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Control on different sheet than the executable
possibly use the codename of the sheet. In the project explorer you see two
names sheet1 (sheet1) sheet1 is the code name the name in () is the tab name. you use the code name like sheet1.Range("A1") and the tab name you already would be familiar with Worksheets("Sheet1").Range("A1") if you renamed the tab to Dog it would be Sheet1.Range("A1") Worksheets("Dog").Range("A1") see - the codename doesn't change. -- Regards, Tom Ogilvy "BearTrap3" wrote: I need to replace ActiveSheet with the sheet name but I want the user to be able to change the worksheet name without messing up the macro. Any suggestions? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Control on different sheet than the executable
What you want to use is the code name...
sheets("Sheet1").select is the same as Sheet1.Select If they change the tab name then the first statement would bomb but the second statement would not since the user has no ability to mess with the code name... In the VBE you will see all of the sheets listed something like this Sheet1(mysheet) Sheet1 is the code name and mysheet is the tab name. You can change the code name by looking at the properties of the sheet and the first item (Name) is the code name. If you change this then you will see shtWhatever(mysheet) in project explorere in the VBE... Now you would refer to the sheet as shtWhatever.Select -- HTH... Jim Thomlinson "BearTrap3" wrote: I need to replace ActiveSheet with the sheet name but I want the user to be able to change the worksheet name without messing up the macro. Any suggestions? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel into executable | Excel Worksheet Functions | |||
VB executable | Excel Programming | |||
Convert Multi-Sheet Workbook to Standalone Executable | Excel Discussion (Misc queries) | |||
macro to executable | Excel Programming |