Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Dim person, needs help

Please help

All I want to do is write (record and edit) a macro in
excel that will repeat the calculate (F9) function every 5
seconds for a set period i.e. an hour.

I am really sure this is very easy if you know how. This
is for use in a small countdown program that at the moment
I manually have to hit the F9 key.

Can someone guide me, thanks in advance.

wooders
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Dim person, needs help


Sub calc_it()
Application.Calculate
Application.OnTime Now + TimeValue("00:00:05"), "calc_it"
End Sub

use tools|macro run to start it and then it will continue
on its own.

LAnce

-----Original Message-----
Please help

All I want to do is write (record and edit) a macro in
excel that will repeat the calculate (F9) function every

5
seconds for a set period i.e. an hour.

I am really sure this is very easy if you know how. This
is for use in a small countdown program that at the

moment
I manually have to hit the F9 key.

Can someone guide me, thanks in advance.

wooders
.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 79
Default Dim person, needs help

Wooders,

This should do it. If you put two buttons on a sheet to run the Initiate and
StopIt routines, you can start and stop the process.

Option Explicit
Private dNextTime As Double
Private dEndTime As Double

Sub Initiate()
dEndTime = Now + TimeValue("01:00:00")
Recalc
End Sub

Sub Recalc()
dNextTime = Now + TimeValue("00:00:05")
If dNextTime < dEndTime Then Application.OnTime dNextTime, "Recalc"
Application.Calculate
End Sub

Sub StopIt()
Application.OnTime dNextTime, "Recalc", , False
End Sub

Robin Hammond
www.enhanceddatasystems.com
Check out our XspandXL add-in


"Wooders" wrote in message
...
Please help

All I want to do is write (record and edit) a macro in
excel that will repeat the calculate (F9) function every 5
seconds for a set period i.e. an hour.

I am really sure this is very easy if you know how. This
is for use in a small countdown program that at the moment
I manually have to hit the F9 key.

Can someone guide me, thanks in advance.

wooders



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Dim person, needs help


LAnce

Thank you very much for your help. Although this is a very simple file
(my excel authoring) it has brought a great deal of pleasure to my
better half, who has this running showing days, hours etc remaining
until we go on holiday.

Again many thanks

Wooders


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
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 CC a workbook to a person by VBA Farhad Excel Discussion (Misc queries) 4 September 24th 07 10:00 PM
How to calculate age of a person? Grd New Users to Excel 2 August 28th 07 11:50 PM
how do I calculate the age of a person S Excel Worksheet Functions 5 March 13th 07 08:11 PM
person name smart tag Judith Excel Discussion (Misc queries) 0 March 12th 07 03:37 PM
Determining the Age of a Person mpenkala Excel Worksheet Functions 5 December 21st 06 02:48 PM


All times are GMT +1. The time now is 04:59 PM.

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

About Us

"It's about Microsoft Excel"