Sheldon Livingston
asked on
Excel worksheet name
In VBA you can name a worksheet through its properties window.
This is not the same name that is displayed on a tab. This method is an attempt to keep the sheet name constant so that if a user renames a sheet, you can still control it.
My problem is that I need to determine which sheet I am on using that same VBA name property.
This is not the same name that is displayed on a tab. This method is an attempt to keep the sheet name constant so that if a user renames a sheet, you can still control it.
My problem is that I need to determine which sheet I am on using that same VBA name property.
Do you want
Activesheet.name
Activesheet.name
make the first row(1) and column(A) hidden and put some secret text in cell A1. (or any other cell of your choice.)
In the VBA script loop through all the sheets and where every you find the secret key in cell A1 rename the sheet to the desired name.
In the VBA script loop through all the sheets and where every you find the secret key in cell A1 rename the sheet to the desired name.
Can you be more explicit about what your question is? What are you trying to do?
Kevin
Kevin
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Kevin... let's say I name them the same and the user changes the name?
ssaqibh: ActiveSheet.name gives you the name on the tab.
viralypatel: Trying not to resort to that kind of a work around.
So, the first sheet tab and show Sheet1 and the second one can show Sheet2. You can change, from Atl + F11, the name "propertiy" of the sheets to wksFirst and wksSecond. Now the user changs the tabs to read Sheet A and Sheet B. From VBA how do I know if the active sheet is wksSecond, Sheet B or Sheet2?
ssaqibh: ActiveSheet.name gives you the name on the tab.
viralypatel: Trying not to resort to that kind of a work around.
So, the first sheet tab and show Sheet1 and the second one can show Sheet2. You can change, from Atl + F11, the name "propertiy" of the sheets to wksFirst and wksSecond. Now the user changs the tabs to read Sheet A and Sheet B. From VBA how do I know if the active sheet is wksSecond, Sheet B or Sheet2?
ASKER
ssaqibh: !!!!
Thanks
codename is it.
Thanks
codename is it.
ASKER
Perfect!
Tab Name: My Sheet
VBA Name: wksMySheet
Kevin