ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Selecting a sheet by code name (https://www.excelbanter.com/excel-programming/307959-selecting-sheet-code-name.html)

Dr.Schwartz

Selecting a sheet by code name
 
Can anyone please supply me with the syntax for selecting a sheet by the code
name - NOT by name: sheets("MySheet").select

Thanks
The Doctor

Paul B[_8_]

Selecting a sheet by code name
 
Sheet1.Select

--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2000 & 2003
** remove news from my email address to reply by email **

"Dr.Schwartz" wrote in message
...
Can anyone please supply me with the syntax for selecting a sheet by the

code
name - NOT by name: sheets("MySheet").select

Thanks
The Doctor




pikus

Selecting a sheet by code name
 
In your project explorer you see the names of sheets listed like:
Sheet1 (Sheet1)
Sheet2 (Sheet2)
etc.

If you change the tab names it becomes:
Sheet1 (My Sheet)
Sheet2 (His Sheet)
etc.

In the second example, to refer to Sheets("My Sheet") by code name you
simply use:
Sheet1

For example:
Sheet1.Select

The code names can be chanced from the Properties window. Open the
properties window and click on the sheet you want to rename in the
project explorer. You'll then see the code name at the top of the
properties window where it can be edited. - pikus


---
Message posted from http://www.ExcelForum.com/



All times are GMT +1. The time now is 09:18 PM.

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