Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Auto execute a macro if a cell value=1 ?


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

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

Right now it seams like the macro is executed all the time every 6
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 lik
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, Sve

--
Sve
-----------------------------------------------------------------------
Sven's Profile: http://www.excelforum.com/member.php...nfo&userid=954
View this thread: http://www.excelforum.com/showthread.php?threadid=21954

  #2   Report Post  
Posted to microsoft.public.excel.programming
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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Auto Execute Macro dennis[_2_] Excel Discussion (Misc queries) 4 January 17th 09 04:47 PM
Auto-execute macro.... Eric @ SEASH, Evansville Excel Discussion (Misc queries) 1 August 24th 05 09:32 PM
Auto execute a macro if a cell value=1 ? Sven[_5_] Excel Programming 1 November 15th 04 02:33 PM
Auto execute a macro if a cell value=1 ? Sven[_4_] Excel Programming 1 November 14th 04 11:36 PM
Auto execute a macro if a cell value=1 ? Sven[_2_] Excel Programming 3 May 16th 04 12:06 AM


All times are GMT +1. The time now is 09:26 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"