View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Henry[_4_] Henry[_4_] is offline
external usenet poster
 
Posts: 72
Default Code to refresh macro once monthly

Rcar,

Private Sub Update()
'Is this the last day of the month (actually looks for the 0th day of the
next month)?
If Date = DateSerial(Year(Date),Month(Date)+1,0) then

'Update your data.
'If you don't want the users to access the new data, SaveAs temporary
filename and
' close workbook.
End If
'Rest of your stuff.

End Sub

If someone opens the spreadsheet I don't want the figures to change.

Before, after, during the update???


"Rcar" wrote in message
...
I have a macro with several Web Queries that I use to
update data in a spreadsheet. I want the macro to only
refresh the web queries once a month(end of month) so it
can then be captured for data analysis. If someone opens
the spreadsheet I don't want the figures to change. What
code do I use for that?