Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
automatically appending newly added data on worksheet to a master list worksheet tabylee via OfficeKB.com Links and Linking in Excel 0 December 17th 09 04:24 PM
plot graph from multiple worksheet as embedded chart object on every worksheet [email protected] Excel Discussion (Misc queries) 2 August 24th 06 05:26 PM
Upload multiple text files into 1 excel worksheet + put the filename as the first column in the worksheet Aster Excel Worksheet Functions 3 March 12th 06 09:58 AM
I want in one worksheet to relatively link to/reference cells in another without changing the format of the current worksheet. [email protected] Excel Discussion (Misc queries) 0 September 22nd 05 04:39 PM
Attaching a JET database to an Excel Worksheet OR storing large binary data in a worksheet Ant Waters Excel Programming 1 September 3rd 03 11:34 AM


All times are GMT +1. The time now is 05:01 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"