View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Auto execute a macro if a cell value=1 ?

Test in MacroX if B3 = 1, if not then exit.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Sven" wrote in message
...

Hi,
Yippey, Now the macroX execute every 60 seconds, brilliant!!

But: I want this automatic procedure every 60 seconds ONLY if cell
B3=1

Right now it seams like the macro is executed all the time every 60
seconds
In other words: It doesn't matter what cell B3 contains.

How can I adjust the VBA code for that? The currrent code looks like
the following:

Private Sub Worksheet_Change(ByVal Target As Range)
Set i = Application.Intersect(Target, Range("B3"))
If Not i Is Nothing And Target.Value = 1 Then MacroX
Application.OnTime Now + TimeValue("00:01:00"), "MacroX"
End Sub

Thanks, Sven


--
Sven
------------------------------------------------------------------------
Sven's Profile:

http://www.excelforum.com/member.php...fo&userid=9548
View this thread: http://www.excelforum.com/showthread...hreadid=219545