Using a sheet's 'Codename'

M

Michelle

How can I use a sheet's 'Codename' to do something like select a sheet in
the application, or put a number in the sheet's cell A1?

I am looking for a way of refering to a specific sheet regardless of its
name or position (you know how users like to change these things).

thanks

M
 
L

Lars-Åke Aspelin

How can I use a sheet's 'Codename' to do something like select a sheet in
the application, or put a number in the sheet's cell A1?

I am looking for a way of refering to a specific sheet regardless of its
name or position (you know how users like to change these things).

thanks

M


Try this:

Sheet1.Cells(1, "A") = 17

It will work even if Sheet1 has been renamed.

Here is some more information about CodeName

http://www.ozgrid.com/VBA/excel-vba-sheet-names.htm

Hope this helps / Lars-Åke
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top