Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 173
Default How do I stop a macro from running within a macro?

Hi, I have got everything set up so that when a cell is selected, it would
bring up the date calendar in order to insert the date. The problem I have is
when I want to clear down all the data that has been entered onto the
worksheet including the cells that contain the dates (using another macro) it
stops on the cells and brings up the calendars, whereas this time I dont
want them to.
Is there someway I can enter something into my clear down code that would
temporarily stop the calendars from popping up?
Many thanks in advance
John

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default How do I stop a macro from running within a macro?

Hi JohnUK,

Try rewritng your code to avoid selectiions.

It is rarely necessary to make selections.

If, however, selection *is* necessary, then you could temporarily disable
the event code that displays the calendar control by using using the
EnableEvents property in the data clearing sub:

Sub ClearData

On Error GoTo CleanUp 'To reset Events in case of error!
Application.EnableEvents = False

'Your clearing code

CleanUp:
Application.EnableEvents = True

End sub

---
Regards,
Norman



"JohnUK" wrote in message
...
Hi, I have got everything set up so that when a cell is selected, it would
bring up the date calendar in order to insert the date. The problem I have
is
when I want to clear down all the data that has been entered onto the
worksheet including the cells that contain the dates (using another macro)
it
stops on the cells and brings up the calendars, whereas this time I don't
want them to.
Is there someway I can enter something into my clear down code that would
temporarily stop the calendars from popping up?
Many thanks in advance
John



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 stop a Macro from running? JulianB Excel Worksheet Functions 1 April 10th 06 10:33 PM
Stop running a macro in the middle of a macro gmunro Excel Programming 3 June 9th 05 06:00 PM
How to stop a macro while it is running ? Srikanth[_7_] Excel Programming 1 September 15th 04 12:59 AM
When Save As stop running macro M K W Excel Programming 3 September 2nd 03 03:06 PM
How to Pause or Stop a running Macro jfeka[_2_] Excel Programming 0 July 17th 03 11:14 PM


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