View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Chris Chris is offline
external usenet poster
 
Posts: 244
Default Auto execute a macro if a cell value=1 ?

'inside MacroX put this in as the first statemen
If Sheets("YourSheet").Range("b3") < 1 Then Exit Su

'put this in as the last statement,
Application.OnTime Now + TimeValue("00:01:00"), "MacroX

'this will cause a recursive execution of the macro as long as Range("B3")=
'I did it this way because i don't know how long your Macro will run for
'else do it like this: as first statemen

If Sheets("YourSheet").Range("b3") = 1 The
Application.OnTime Now + TimeValue("00:01:00"), "MacroX
End If

'I make no promises with the OnTime Method, so good luck
----- Sven wrote: ----

Thanks ~Ã

A agree that it may not be the most efficient way to do it but ho
would you incorporate this into the answer you gave

For example that the macro is executed over and over again with a
interval every 60 seconds until cell B3 is not equal to

Thanks
Sve


--
Message posted from http://www.ExcelForum.com