Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Workbook_SheetChange triggered to many times

Hi there!

When user enters some text in a cell, I use macros to validate.
If there are some incorrect data I want to correct this
programmatically. So I use the SheetChange event.

The problem is that when I correct what the user entered, the event
is fired once again, and then again and again and again... I think you
understand the problem...

How can I work around this problem, is it for example possible to
temporarily disable the event?

Best Regards

L-E
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default Workbook_SheetChange triggered to many times

Before you write to the cell, tell excel to stop looking for changes.


application.enableevents = false
'your code here
application.enableevents = true

Devvy D wrote:

Hi there!

When user enters some text in a cell, I use macros to validate.
If there are some incorrect data I want to correct this
programmatically. So I use the SheetChange event.

The problem is that when I correct what the user entered, the event
is fired once again, and then again and again and again... I think you
understand the problem...

How can I work around this problem, is it for example possible to
temporarily disable the event?

Best Regards

L-E


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Workbook_SheetChange triggered to many times

Thanks a lot, never used that before, but it works like a charm!

Dave Peterson wrote:
Before you write to the cell, tell excel to stop looking for changes.


application.enableevents = false
'your code here
application.enableevents = true

Devvy D wrote:

Hi there!

When user enters some text in a cell, I use macros to validate.
If there are some incorrect data I want to correct this
programmatically. So I use the SheetChange event.

The problem is that when I correct what the user entered, the event
is fired once again, and then again and again and again... I think you
understand the problem...

How can I work around this problem, is it for example possible to
temporarily disable the event?

Best Regards

L-E



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
Worksheet_Change and Workbook_SheetChange not firing David Jenkins[_2_] Excel Programming 4 September 2nd 04 08:02 PM
Workbook_sheetChange event J S Excel Programming 0 August 9th 04 07:16 PM
workbook_sheetchange JulieD Excel Programming 1 June 14th 04 04:32 AM
Problem with the Workbook_SheetChange event??? angel Excel Programming 0 January 29th 04 02:56 PM
Workbook_SheetChange will not fire Robert Willard Excel Programming 1 September 10th 03 07:52 PM


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