Calculating results when data changes
You need to either disable events while doing your Calculate_Results
stuff
application.enableevents=false
Calculate_Results
application.enableevents=true
or use a flag inside your sheetchange handler
Static bProcessing as boolean
if bprocessing then exit sub
bProcessing=true
Calculate_Results
bProcessing=false
Hope this helps
Tim.
"Gary Paris" wrote in message
...
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
|