Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
determine what sheet user is viewing
This is probably very simple.
How can I make VBA know what sheet the user is viewing at the time they activate a macro? For instance, if they are looking at sheet 17, I want the macro's dialog box to customize itself to limit its choices to those relevant to sheet 17. I can do the customization, but don't know the 'if worksheet 17 is active then...' command. Thanks. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
determine what sheet user is viewing
If ActiveSheet.Name = "theName" Then
-or- If ActiveSheet.CodeName = "theName" Then Will serve your purpose. The ".Name" property will give the name that is displayed on the SheetTab. The ".CodeName" property will give the internal name of the sheet (e.g. Sheet1, Sheet2, etc.), which can't be changed by the user. If the user happens to rename the sheet, your macro will probably break if you use ".Name". Troy "Elias" wrote in message ... This is probably very simple. How can I make VBA know what sheet the user is viewing at the time they activate a macro? For instance, if they are looking at sheet 17, I want the macro's dialog box to customize itself to limit its choices to those relevant to sheet 17. I can do the customization, but don't know the 'if worksheet 17 is active then...' command. Thanks. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
logging user name after viewing protected workbook | New Users to Excel | |||
Password protect sheet from viewing | Excel Worksheet Functions | |||
Viewing file user history | Excel Discussion (Misc queries) | |||
MS EXCEL SHEET CRASHES WHEN VIEWING | Excel Discussion (Misc queries) | |||
How do I deny opening and viewing any file to any user and lock i. | Excel Discussion (Misc queries) |