Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 71
Default diable macro if a certain sheet is active

How can I disable a macro from running if a certain sheet is active.
example

if sheet "new" is active I can run a macro that will hide certain rows
if sheet "old" is active the same macro will not be able to hide the rows in
the macro

any ideas??
--
crunchin numbers
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,346
Default diable macro if a certain sheet is active

Add the following line at the beginning of the macro

If ActiveSheet.Name = "old" then Exit Sub

--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire


"belvy123" wrote:

How can I disable a macro from running if a certain sheet is active.
example

if sheet "new" is active I can run a macro that will hide certain rows
if sheet "old" is active the same macro will not be able to hide the rows in
the macro

any ideas??
--
crunchin numbers

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default diable macro if a certain sheet is active

Add the below at the beginning of the marco.

If ActiveSheet.Name < "New" then Exit Sub

If this post helps click Yes
---------------
Jacob Skaria


"belvy123" wrote:

How can I disable a macro from running if a certain sheet is active.
example

if sheet "new" is active I can run a macro that will hide certain rows
if sheet "old" is active the same macro will not be able to hide the rows in
the macro

any ideas??
--
crunchin numbers

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,934
Default diable macro if a certain sheet is active

Your question leaves out a detail that I think is necessary for us to
know... what if the rows are already hidden and the "old" sheet is made
active... should the code unhide the rows in that situation?

In order to get a better answer, you should post your code so we can tell
you how to change it to do what you want.

--
Rick (MVP - Excel)


"belvy123" wrote in message
...
How can I disable a macro from running if a certain sheet is active.
example

if sheet "new" is active I can run a macro that will hide certain rows
if sheet "old" is active the same macro will not be able to hide the rows
in
the macro

any ideas??
--
crunchin numbers


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
emailing active sheet with macro BIGBOY1974AA Excel Worksheet Functions 2 July 18th 08 08:23 AM
macro active sheet liem Excel Discussion (Misc queries) 1 January 18th 08 05:48 AM
list sheet names vertically below the active cell - need macro. Eddy Stan Excel Worksheet Functions 2 September 28th 07 07:48 PM
copy name from active sheet to cell - using macro or function dymek Excel Worksheet Functions 2 October 2nd 06 12:32 PM
How to change macro so it performs actions on ACTIVE sheet? Tom9283 Excel Discussion (Misc queries) 6 April 15th 05 07:32 AM


All times are GMT +1. The time now is 11:20 PM.

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"