Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro to enable or visible on specific worksheet only
Hi,
I have a macro on personal workbook and have it visible on the toolbars. I would like have it made enable and visible only when I open a specific worksheet and not otherwise. I am using excel 2002 pls advice |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro to enable or visible on specific worksheet only
You could have code which activates when a workbook opens.
The code would add the macro as a button to the toolbar. A condition within the code would check to see if the workbook is a certain name, which would determine whether to add to the toolbar. I have toolbar button examples on my website. -- Rob van Gelder - http://www.vangelder.co.nz/excel "Edgar" wrote in message ... Hi, I have a macro on personal workbook and have it visible on the toolbars. I would like have it made enable and visible only when I open a specific worksheet and not otherwise. I am using excel 2002 pls advice |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro to enable or visible on specific worksheet only
In your personal.xls, in Workbook_Open , hide the toolbar
Application.Commandbars("Standard").Controls("myBu tton").Visible = False and then in the Workbook_Activate event for you workbook, set it to true. Tidy up with setting it to false in the workbook_Deactivate event, and i the personal.xls Workbook_BeforeClose event. -- HTH ------- Bob Phillips "Edgar" wrote in message ... Hi, I have a macro on personal workbook and have it visible on the toolbars. I would like have it made enable and visible only when I open a specific worksheet and not otherwise. I am using excel 2002 pls advice |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro to enable or visible on specific worksheet only
Hi,
I was not clear before i think. I have a worksheet named "My data". There is only 1 worksheet in the xls file. But the macro is in the Personal.xls file, which is available to any other worksheet opened. I want the macro to be visible only when this file(My Data) is opened. And it should be disabled when this file is closed. this way I don't get to see the macro, when I am working on other worksheets thanks. -----Original Message----- In your personal.xls, in Workbook_Open , hide the toolbar Application.Commandbars("Standard").Controls ("myButton").Visible = False and then in the Workbook_Activate event for you workbook, set it to true. Tidy up with setting it to false in the workbook_Deactivate event, and i the personal.xls Workbook_BeforeClose event. -- HTH ------- Bob Phillips "Edgar" wrote in message ... Hi, I have a macro on personal workbook and have it visible on the toolbars. I would like have it made enable and visible only when I open a specific worksheet and not otherwise. I am using excel 2002 pls advice . |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro to enable or visible on specific worksheet only
Why not store the macro in "my data" ?
-- Rob van Gelder - http://www.vangelder.co.nz/excel "Edgar" wrote in message ... Hi, I was not clear before i think. I have a worksheet named "My data". There is only 1 worksheet in the xls file. But the macro is in the Personal.xls file, which is available to any other worksheet opened. I want the macro to be visible only when this file(My Data) is opened. And it should be disabled when this file is closed. this way I don't get to see the macro, when I am working on other worksheets thanks. -----Original Message----- In your personal.xls, in Workbook_Open , hide the toolbar Application.Commandbars("Standard").Controls ("myButton").Visible = False and then in the Workbook_Activate event for you workbook, set it to true. Tidy up with setting it to false in the workbook_Deactivate event, and i the personal.xls Workbook_BeforeClose event. -- HTH ------- Bob Phillips "Edgar" wrote in message ... Hi, I have a macro on personal workbook and have it visible on the toolbars. I would like have it made enable and visible only when I open a specific worksheet and not otherwise. I am using excel 2002 pls advice . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I get a macro to be non worksheet specific? | Excel Worksheet Functions | |||
Avoiding the worksheet specific name in a macro | Excel Discussion (Misc queries) | |||
How to run specific macro on selected worksheet? | Excel Discussion (Misc queries) | |||
make a macro 'worksheet specific' | Excel Discussion (Misc queries) | |||
Help with a macro to open to a specific worksheet | Excel Worksheet Functions |