View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
 
Posts: n/a
Default Automatically Refreshing Data at 12am

I want to automatically refresh my data every day at 12am. Does
something like this make sence?

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