Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default REPEAT SOME ACTION IN MACRO

Hi dear friends,

its an simple question for you....
i want to repeat some action in my excel workbook at every 5 minuts.. by the
help of VB

just like

Private Sub Workbook_Open()
Application.ScreenUpdating = false
dim ST, NT as date
ST = timer
nt = st + TimeValue("00:05:00")
loop
if nt = timer then
call XXX
end if
do events
end loop
End Sub

can anyone help me??

thanks in advance

suresh tp


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default REPEAT SOME ACTION IN MACRO


Code:
--------------------

Private Sub Workbook_Open()
Application.OnTime Now + TimeValue("00:00:05"), "OnTimer"
End Sub

Sub OnTimer
dim ST as Date, NT as date
Application.ScreenUpdating = false
'*
'* Your code here
'*
DoEvents
'*
'* Reschedule the interrupt
'*
Application.OnTime Now + TimeValue("00:00:05"), "OnTimer"
Application.ScreenUpdating = True
End Sub

--------------------


Regards

Rich


--
Rich_z
------------------------------------------------------------------------
Rich_z's Profile: http://www.excelforum.com/member.php...o&userid=24737
View this thread: http://www.excelforum.com/showthread...hreadid=384269

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default REPEAT SOME ACTION IN MACRO

If you want to read more about Excel's VBA OnTime method, visit Chip Pearson's
site:
http://www.cpearson.com/excel/ontime.htm

SURESH wrote:

Hi dear friends,

its an simple question for you....
i want to repeat some action in my excel workbook at every 5 minuts.. by the
help of VB

just like

Private Sub Workbook_Open()
Application.ScreenUpdating = false
dim ST, NT as date
ST = timer
nt = st + TimeValue("00:05:00")
loop
if nt = timer then
call XXX
end if
do events
end loop
End Sub

can anyone help me??

thanks in advance

suresh tp


--

Dave Peterson
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
macro to action formula pvkutty New Users to Excel 1 February 13th 10 02:01 PM
Excell copy action pauses for 15 second for the smallest action Meekal Excel Discussion (Misc queries) 1 January 28th 10 04:30 PM
Repeat last action Teri Excel Worksheet Functions 5 July 13th 06 04:11 PM
on particular action run a macro Jelinek Excel Discussion (Misc queries) 1 February 3rd 06 01:21 PM
repeat an action in different locations countrypotter Excel Worksheet Functions 0 August 10th 05 03:26 PM


All times are GMT +1. The time now is 09:36 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"