Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Set Worksheet Name
Hi
Is it possible to set the names of each worksheet in a module so I can refer to it within the sheets itself. ie Set wksCurrent = worksheets("Sheet1") set wksKey = worksheets("Sheet2") etc The above is what I would like to declare and have set in a module and then in the worksheets i would use wksCurrent.select wksKey.visible = true etc. I am hoping that I dont need to keep adding the Set wksCurrent = Worksheets("Sheet1") etc for each private or public sub. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Set Worksheet Name
Declare the variables wksCurrent and wksKey as public variables before any
macros (type Worksheet), and in the first module set them as you show, and it will remain available for all macros. -- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) "Noemi" wrote in message ... Hi Is it possible to set the names of each worksheet in a module so I can refer to it within the sheets itself. ie Set wksCurrent = worksheets("Sheet1") set wksKey = worksheets("Sheet2") etc The above is what I would like to declare and have set in a module and then in the worksheets i would use wksCurrent.select wksKey.visible = true etc. I am hoping that I dont need to keep adding the Set wksCurrent = Worksheets("Sheet1") etc for each private or public sub. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
automatically appending newly added data on worksheet to a master list worksheet | Links and Linking in Excel | |||
plot graph from multiple worksheet as embedded chart object on every worksheet | Excel Discussion (Misc queries) | |||
Upload multiple text files into 1 excel worksheet + put the filename as the first column in the worksheet | Excel Worksheet Functions | |||
I want in one worksheet to relatively link to/reference cells in another without changing the format of the current worksheet. | Excel Discussion (Misc queries) | |||
Attaching a JET database to an Excel Worksheet OR storing large binary data in a worksheet | Excel Programming |