#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 63
Default Skip a Macro

I have a worksheet_selection change macro, that I would like to skip if
another Macro is running, is that possible? Is it possible to tell if a macro
is commanding the change or the user?

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Skip a Macro

Vick,

Try this

Application.EnableEvents = False
'Your code
Application.EnableEvents = True

Mike

"Vick" wrote:

I have a worksheet_selection change macro, that I would like to skip if
another Macro is running, is that possible? Is it possible to tell if a macro
is commanding the change or the user?

Thanks

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Skip a Macro

If you have a macro that causes the worksheet_selection change event to fire,
you can tell excel to stop monitoring these changes.

In your macro

application.enableevents = false
selection.offset(1,0).select 'or whatever your code does
application.enableevents = true

But even better would be to change your macro so that it's not selecting
anything when it runs. There aren't many things that have to be selected to
work on them.



Vick wrote:

I have a worksheet_selection change macro, that I would like to skip if
another Macro is running, is that possible? Is it possible to tell if a macro
is commanding the change or the user?

Thanks


--

Dave Peterson
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
using IF to skip Julie Excel Worksheet Functions 4 March 14th 08 10:21 PM
Macro Skip workbook [email protected] Excel Worksheet Functions 1 February 7th 08 04:24 PM
Macro Skip workbook [email protected] Excel Worksheet Functions 0 February 7th 08 03:54 PM
Quick Macro question - How to delete two rows then skip one - and repeat David Smithz Excel Discussion (Misc queries) 3 March 3rd 06 02:58 PM
Sheets Skip Macro NICK Excel Discussion (Misc queries) 2 February 11th 05 07:16 AM


All times are GMT +1. The time now is 06:59 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"