Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I get a macro to be non worksheet specific? navel151 Excel Worksheet Functions 6 January 4th 10 09:46 PM
Avoiding the worksheet specific name in a macro Jeff Modares Excel Discussion (Misc queries) 2 September 23rd 09 07:57 PM
How to run specific macro on selected worksheet? Harshad[_2_] Excel Discussion (Misc queries) 2 October 31st 08 06:56 AM
make a macro 'worksheet specific' Lori Excel Discussion (Misc queries) 11 October 29th 07 12:38 AM
Help with a macro to open to a specific worksheet EAHRENS Excel Worksheet Functions 0 November 30th 05 08:36 PM


All times are GMT +1. The time now is 12:02 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"