ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Worksheet_Change - loop within a loop (https://www.excelbanter.com/excel-programming/288378-worksheet_change-loop-within-loop.html)

bgm

Worksheet_Change - loop within a loop
 
Hi there

I am using WorkSheet_change to ascertain whether data has changed on the spreadsheet, and from there I check to see which cell it changed in. If it changed in a certain cell then I change all the values in that column using a For..Next loop. The only problem here is that it seems to trigger the Worksheet_Change macro everytime it changes one cell and starts at the beginning. Is there a way to surpress the Worksheet_Change trigger while performing a function

thanks in advance.

Bob Phillips[_6_]

Worksheet_Change - loop within a loop
 
Yes, precede the code with

Application.EnableEvents = False

make sure that you set it back to true before exiting the event macro.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"bgm" wrote in message
...
Hi there,

I am using WorkSheet_change to ascertain whether data has changed on the

spreadsheet, and from there I check to see which cell it changed in. If it
changed in a certain cell then I change all the values in that column using
a For..Next loop. The only problem here is that it seems to trigger the
Worksheet_Change macro everytime it changes one cell and starts at the
beginning. Is there a way to surpress the Worksheet_Change trigger while
performing a function?

thanks in advance.





All times are GMT +1. The time now is 11:25 AM.

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