Using a sheet's 'Codename'

  • Thread starter Thread starter Michelle
  • Start date Start date
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
 
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
 
Back
Top