Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 64
Default repeat macro after time interval

Hi all,

I am trying to find a macro that will re run my macro after say 20 minutes
from when it is first run (or when the spreadsheet is opened- whichever is
easier) , and again 20 mintues after that etc until the spread sheet is
closed. Having it avoid re running while a user is editing the spreadsheet
would also be handy.

Yours in confusion
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,173
Default repeat macro after time interval

Mike

Take a look at the OnTime method. It runs like so

Sub RunCode()
Application.OnTime Now + TimeValue("00:20:00"), "RunThis"
End Sub

Sub RunThis()
ActiveCell.Value = Now
Call RunCode
End Sub

You could put the first code in the Workbook_Open() event in the
ThisWorkbook module and this would fire when the workbook opens

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
DTHIS
www.nickhodge.co.uk


"MikeM" wrote in message
...
Hi all,

I am trying to find a macro that will re run my macro after say 20 minutes
from when it is first run (or when the spreadsheet is opened- whichever is
easier) , and again 20 mintues after that etc until the spread sheet is
closed. Having it avoid re running while a user is editing the spreadsheet
would also be handy.

Yours in confusion


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
how to run a macro automatically at fixed time interval wyh Excel Discussion (Misc queries) 0 December 24th 10 01:39 AM
Help with time interval [email protected] Excel Worksheet Functions 10 December 27th 08 11:08 PM
Repeat a formula with interval BarbnSLC Excel Worksheet Functions 5 January 1st 08 03:14 AM
Repeat a formula with interval Kees Vos[_2_] Excel Worksheet Functions 4 December 6th 07 02:26 PM
how to have a module to repeat itself at a certain time interval? Radionise Excel Programming 2 April 14th 04 08:10 AM


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