Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default On Change Event

Hi Group:

I created a macro to pop up a message box under certain conditions using the
Workbook_Change property of a worksheet. However sometimes it seems to stop
working. What could cause this?

JJ


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default On Change Event

This will happen if worksheet events are left dis-abled.

Many Event macros disable events, do some processing, and then re-enable
them before exiting. If the routine exits prematurally, the dis-able may be
left in effect.
--
Gary's Student


"Jeanne Conroy" wrote:

Hi Group:

I created a macro to pop up a message box under certain conditions using the
Workbook_Change property of a worksheet. However sometimes it seems to stop
working. What could cause this?

JJ



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default On Change Event

Hi Jeanne,

Just to add to Student's response, in order to prevent the observed
behaviour, when events are disabled in the code, it is advisable to
re-enable events in an error handler, e.g:

'=============
Private Sub Worksheet_SelectionChange(ByVal Target As Range)

On Error GoTo XIT
Application.EnableEvents = False

'your code

XIT:
Application.EnableEvents = True
End Sub
'<<=============



---
Regards,
Norman


"Jeanne Conroy" wrote in message
...
Hi Group:

I created a macro to pop up a message box under certain conditions using
the
Workbook_Change property of a worksheet. However sometimes it seems to
stop
working. What could cause this?

JJ




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
MsgBox in Enter event causes combobox not to run Change event Richard Excel Programming 0 March 6th 06 02:52 PM
Change event and calculate event Antje Excel Programming 1 March 29th 05 09:03 PM
Change Cell from Validated List Not Firing Worksheet Change Event [email protected] Excel Programming 3 October 4th 04 03:00 AM
change event/after update event?? scrabtree23[_2_] Excel Programming 1 October 20th 03 07:09 PM


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