Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default final answer to run macro at certain time


Hi!

I have searched this forum a number of times for a definite answer on
how to time macro execution, but have not found anything that helped.

Problem I have:

Run macro either at certain time(s) of day or in certain time interval
(whichever is easier).

Preferably using really easy code in which I understand what to
substitute to change the time interval, as I'm not too familiar with
the whole VBA thing.

Anybody got any (simple) ideas?

Thanks!

sass


--
as_sass
------------------------------------------------------------------------
as_sass's Profile: http://www.excelforum.com/member.php...fo&userid=9065
View this thread: http://www.excelforum.com/showthread...hreadid=477036

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default final answer to run macro at certain time

I don't see a solution if you want to run items periodically with an
interval greater than a day, but for shorter intervals, look at the
Application.Ontime function

See Chip Pearson's example
http://www.cpearson.com/excel/ontime.htm

The workbook will need to remain open.
--
Regards,
Tom Ogilvy

"as_sass" wrote in
message ...

Hi!

I have searched this forum a number of times for a definite answer on
how to time macro execution, but have not found anything that helped.

Problem I have:

Run macro either at certain time(s) of day or in certain time interval
(whichever is easier).

Preferably using really easy code in which I understand what to
substitute to change the time interval, as I'm not too familiar with
the whole VBA thing.

Anybody got any (simple) ideas?

Thanks!

sass


--
as_sass
------------------------------------------------------------------------
as_sass's Profile:

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



  #3   Report Post  
Posted to microsoft.public.excel.programming
JMB JMB is offline
external usenet poster
 
Posts: 2,062
Default final answer to run macro at certain time

You could use OnTime to run a macro at a specified interval. In this
example, "Test" will run "Test2" after 10 seconds. Then, when Test2 runs, it
will call the first macro and the process repeats.


Sub Test()
Application.OnTime Now + TimeValue("00:00:10"), "Test2"
End Sub

Sub test2()
MsgBox "Hello"
Call Test
End Sub


"as_sass" wrote:


Hi!

I have searched this forum a number of times for a definite answer on
how to time macro execution, but have not found anything that helped.

Problem I have:

Run macro either at certain time(s) of day or in certain time interval
(whichever is easier).

Preferably using really easy code in which I understand what to
substitute to change the time interval, as I'm not too familiar with
the whole VBA thing.

Anybody got any (simple) ideas?

Thanks!

sass


--
as_sass
------------------------------------------------------------------------
as_sass's Profile: http://www.excelforum.com/member.php...fo&userid=9065
View this thread: http://www.excelforum.com/showthread...hreadid=477036


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
adding time and splitting the answer ramona Excel Discussion (Misc queries) 1 December 9th 09 10:31 PM
display calculation steps - not final answer skwiff Excel Worksheet Functions 2 October 30th 09 03:26 PM
index and match, then subtract, divide and add for my final answer ladygr Excel Worksheet Functions 3 April 16th 09 11:04 PM
Macro - Final ciba1234 Excel Programming 1 September 15th 05 09:14 PM
Subtract one time from another and get answer in minutes Zoombini Excel Discussion (Misc queries) 3 April 22nd 05 12:56 AM


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