View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson[_5_] Dave Peterson[_5_] is offline
external usenet poster
 
Posts: 1,758
Default Calculating results when data changes

You can tell excel to stop looking for changes.

Then your code can make the change it needs to make and the event won't be
called.

In general:

application.enableevents = false 'tell excel to stop looking
'your code that does something that would have fired an event
application.enableevents = true 'tell excel to start looking again.

Gary Paris wrote:

I have a range of data that encompasses anywhere from 20 rows to 50 rows and
5 columns.

I have a routine that I call Calculate_Results that is called from the
Workbook_SheetChange routine.
The problem is that once the results are calculated, I would like to place
totals into a cell on another
worksheet. Problem is the routine goes forever. Calculate_Results
generates a SheetChange and SheetChange calls Calculate_Results.

How can I call Calculate_Results whenever there is data modification in the
area I would like to change?

Thanks,

Gary


--

Dave Peterson