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

A have a Worksheet_Change event set to take action if specific cells are
modified.

The routine validates the change, and then performs a calculation, and
places the answer in another cell.

After the event triggers, the action DESIRED is seen within the first time
the event occurs, but the event KEEPS REPEATING for some reason. I've
determined the event repeats as much as 1,700 times.

Has anyone experienced this before? How can I stop it from occuring?

Thanx!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Worksheet Change Event Triggering Multiple Times

Hi,

Changing cells calls the event again so you must disable events while doing
this

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

Mike

"PosseJohn" wrote:

A have a Worksheet_Change event set to take action if specific cells are
modified.

The routine validates the change, and then performs a calculation, and
places the answer in another cell.

After the event triggers, the action DESIRED is seen within the first time
the event occurs, but the event KEEPS REPEATING for some reason. I've
determined the event repeats as much as 1,700 times.

Has anyone experienced this before? How can I stop it from occuring?

Thanx!

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Worksheet Change Event Triggering Multiple Times

If your code in the Change event procedure changes some cell value,
that will cause the Change event to run again. And it that iteration
changes a cell, Change will run again and again, until it blows up
with an "Out Of Stack Space" error.

Use code like the following to temporarily disable events and prevent
Change from calling itself.

Application.EnableEvents = False
' your code here
Application.EnabeEvents = True

Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)


On Sun, 9 Nov 2008 03:24:05 -0800, PosseJohn
wrote:

A have a Worksheet_Change event set to take action if specific cells are
modified.

The routine validates the change, and then performs a calculation, and
places the answer in another cell.

After the event triggers, the action DESIRED is seen within the first time
the event occurs, but the event KEEPS REPEATING for some reason. I've
determined the event repeats as much as 1,700 times.

Has anyone experienced this before? How can I stop it from occuring?

Thanx!

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 not triggering davegb Excel Programming 1 January 30th 07 10:58 PM
RTD value changes not triggering worksheet change event DTM[_4_] Excel Programming 2 June 7th 06 05:01 PM
Validation not triggering Change event in Excel XP Jeffrey[_8_] Excel Programming 3 March 13th 06 03:33 AM
Validation not triggering Change event in Excel XP Jeffrey[_8_] Excel Programming 1 March 8th 06 01:59 AM
auto-filter change not triggering worksheet_change event mark Excel Programming 1 September 19th 03 03:01 PM


All times are GMT +1. The time now is 10:25 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"