ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Suspending MAcros (https://www.excelbanter.com/excel-programming/311522-suspending-macros.html)

kAVAL

Suspending MAcros
 
I am using a Worksheet_Change macro to update several
cells when a change is made in a specific range.

When the macro changes the other cells it then starts the
Worksheet_Change routine again and I end up with an
endless loop.

Is there an easy way to temporarily suspend the
Worksheet_Change macro while cells are updated and then
re-enable?

Kaval



Tom Ogilvy

Suspending MAcros
 
Application.EnableEvents = False
' code that causes change to fire again
Application.EnableEvents = True
End sub

--
Regards,
Tom Ogilvy


"Kaval" wrote in message
...
I am using a Worksheet_Change macro to update several
cells when a change is made in a specific range.

When the macro changes the other cells it then starts the
Worksheet_Change routine again and I end up with an
endless loop.

Is there an easy way to temporarily suspend the
Worksheet_Change macro while cells are updated and then
re-enable?

Kaval






All times are GMT +1. The time now is 04:05 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com