ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Referencing worksheet just by its name (https://www.excelbanter.com/excel-programming/381096-re-referencing-worksheet-just-its-name.html)

Charles Chickering

Referencing worksheet just by its name
 
If "Setup" is the Code Name of the sheet (Type ?Worksheets("Setup").CodeName
in the immediate window to varify), then that is a perfectly acceptable
syntax.
--
Charles Chickering

"A good example is twice the value of good advice."


"Antonio" wrote:

I am using some VBA code that uses the worksheet name instead of
worksheets(worksheet_name) to reference it.

For example

SETUP.Cells(1,1)=3

instead of Worksheets("SETUP").Cells(1,1)=3

I know how to do that if I use

Dim SETUP as Worksheet

Set SETUP=Worksheets("SETUP")

However, I have looked for the above declarations in the code and don't find
it.

When I type SETUP. I get the intellisense for the worksheet object.

How can it be done?

Thanks,

Antonio



All times are GMT +1. The time now is 08:29 AM.

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