![]() |
Loops and Events
Hi,
Does anyone know how to do the following : I want to execute a procedure/sub over and over again repeatedly, but *only* if a particular cell in Excel is set to, say, "Y". I have tried using a simple loop (Do ... Loop Until etc.) but while this runs the code as wanted, it completely locks up Excel and stops you from doing anything to the cells etc. In other words, there is no way of stopping the code. Also, if I can get this principle working then I can also have other adjustable parameters for the code using other cells. Any ideas? Thanks, Tom |
Loops and Events
You could run it repeatedly using Ontime, say running it every 1, 2,3 secs
or whatever you choose. In the procedure invoked by OnTime, check if the value is Y at the end, if so, reissue the OnTime, if not just exit. Chip Pearson has a nice page on it at http://www.cpearson.com/excel/ontime.htm -- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) "Tom" wrote in message ... Hi, Does anyone know how to do the following : I want to execute a procedure/sub over and over again repeatedly, but *only* if a particular cell in Excel is set to, say, "Y". I have tried using a simple loop (Do ... Loop Until etc.) but while this runs the code as wanted, it completely locks up Excel and stops you from doing anything to the cells etc. In other words, there is no way of stopping the code. Also, if I can get this principle working then I can also have other adjustable parameters for the code using other cells. Any ideas? Thanks, Tom |
All times are GMT +1. The time now is 12:31 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com