ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Automatically Refreshing Data at 12am (https://www.excelbanter.com/excel-discussion-misc-queries/88708-automatically-refreshing-data-12am.html)

[email protected]

Automatically Refreshing Data at 12am
 
I want to set my worksheet that will always be open on my machine to
automatically refresh the data at 12am. Is the only way to do that with
a macro? If so, how do I go about that. Thanks!


Chip Pearson

Automatically Refreshing Data at 12am
 
You need to use VBA code. See www.cpearson.com/excel/ontime.htm
for details and example code.


wrote in message
oups.com...
I want to set my worksheet that will always be open on my
machine to
automatically refresh the data at 12am. Is the only way to do
that with
a macro? If so, how do I go about that. Thanks!




[email protected]

Automatically Refreshing Data at 12am
 
So i can do something like this?
Public RunWhen As Double


Sub StartTimer()

RunWhen = Time() = #12:00:00 AM# + TimeSerial(24, 0, 0)
Application.OnTime earliesttime:=RunWhen, procedu="The_Sub", _
schedule:=True
End Sub

Sub The_Sub()


ActiveWorkbook.RefreshAll
StartTimer

End Sub



All times are GMT +1. The time now is 11:02 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com