close

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!You can use OnTime to schedule a macro to run at a set time. See
www.cpearson.com/excel/ontime.htm

--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)

gt; wrote in message oups.com...
gt; I want to set my worksheet that will always be open on my machine to
gt; automatically refresh the data at 12am. Is the only way to do that with
gt; a macro? If so, how do I go about that. Thanks!
gt;
So I can do something like this?
Public RunWhen As DoubleSub StartTimer()

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

Sub The_Sub()ActiveWorkbook.RefreshAll
StartTimer

End Sub

全站熱搜
創作者介紹
創作者 software 的頭像
software

software

software 發表在 痞客邦 留言(0) 人氣()