Auto refresh macro?

cpg84

Active Member
Joined
Jul 16, 2007
Messages
266
Platform
  1. Windows
Does anyone know if it is possible to have a macro that behaves the same as if you held down the F9 button (refresh)?

I have a clock formula (Weeks, Days, Hours, Minutes, Seconds in separate cells) and I want to press a button to get the screen to constantly refresh so you can see the time tick down.

Also, if I manage to get this, will this affect other, unrelated spreadsheets I have open at the same time?

Thanks
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
You can turn off workbook calculation then use the ontime method to calculate a specific sheet. This will mean that the other sheets will need to be calculated manually or by way of an event.

Code:
Sub turnoff()
'Turn Off calculation and start call ontime routine
Application.Calculation = xlCalculationManual
Call DoTimer
End Sub

Sub DoTimer()
'Call the sheet calculation macro every one second
Application.OnTime Now + TimeValue("00:00:01"), "Rep"

End Sub

Sub Rep()
' calculate the sheet and repeat the ontime process
Sheet1.Calculate
Call DoTimer
End Sub
 
Upvote 0
Cool, thanks.

I will give it a try when I get home this arvo. Hopefully it will work.
 
Upvote 0

Forum statistics

Threads
1,223,880
Messages
6,175,153
Members
452,615
Latest member
bogeys2birdies

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top