ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Using a sheet's 'Codename' (https://www.excelbanter.com/excel-programming/431846-using-sheets-codename.html)

Michelle

Using a sheet's 'Codename'
 
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


Lars-Åke Aspelin[_2_]

Using a sheet's 'Codename'
 
On Fri, 31 Jul 2009 07:01:30 +0100, "Michelle"
wrote:

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


All times are GMT +1. The time now is 09:31 AM.

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