ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Declare Worksheet name over multiple modules (https://www.excelbanter.com/excel-programming/370067-declare-worksheet-name-over-multiple-modules.html)

Noemi

Declare Worksheet name over multiple modules
 
Hi
Is it possible to declare the worksheets name once and use it over multiple
modules.

ie
Dim wksCurrent as worksheet
Set wksCurrent = worksheets("Test")

Once the above is done I want to be able to use the wksCurrent in all of the
modules I have available.

Any ideas would be great.

Thanks


NickHK

Declare Worksheet name over multiple modules
 
Yes, if the Dim statement is in a normal module.

NickHK

"Noemi" wrote in message
...
Hi
Is it possible to declare the worksheets name once and use it over

multiple
modules.

ie
Dim wksCurrent as worksheet
Set wksCurrent = worksheets("Test")

Once the above is done I want to be able to use the wksCurrent in all of

the
modules I have available.

Any ideas would be great.

Thanks




Noemi

Declare Worksheet name over multiple modules
 
Hi Nick
Can you please elaberate on Normal Module???

Do you mean attached to a sheet or an actual module

If an actual module what do I put up the top of the module

Thanks

"NickHK" wrote:

Yes, if the Dim statement is in a normal module.

NickHK

"Noemi" wrote in message
...
Hi
Is it possible to declare the worksheets name once and use it over

multiple
modules.

ie
Dim wksCurrent as worksheet
Set wksCurrent = worksheets("Test")

Once the above is done I want to be able to use the wksCurrent in all of

the
modules I have available.

Any ideas would be great.

Thanks





NickHK

Declare Worksheet name over multiple modules
 
Yes, insert a module and declare the top.
Not on a WS or class module

NickHK

"Noemi" wrote in message
...
Hi Nick
Can you please elaberate on Normal Module???

Do you mean attached to a sheet or an actual module

If an actual module what do I put up the top of the module

Thanks

"NickHK" wrote:

Yes, if the Dim statement is in a normal module.

NickHK

"Noemi" wrote in message
...
Hi
Is it possible to declare the worksheets name once and use it over

multiple
modules.

ie
Dim wksCurrent as worksheet
Set wksCurrent = worksheets("Test")

Once the above is done I want to be able to use the wksCurrent in all

of
the
modules I have available.

Any ideas would be great.

Thanks








All times are GMT +1. The time now is 12:27 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com