View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
buzzharley[_10_] buzzharley[_10_] is offline
external usenet poster
 
Posts: 1
Default Open workbook macro- find correct month to open?


So I have Monthly sales sheets that import my cash register data int
them. I wanted to set them up to do everything without being there.
So I have my task manager open excel at 9:30pm everyday and it runs th
macro to import the data into the correct day of the month. Here is th
workbook open macro-
Code
-------------------
Private Sub Workbook_Open()
Dim dTime As Date
dTime = Time
If dTime = TimeValue("9:30 PM") And _
dTime < TimeValue("9:40 PM") Then
ImportData
End If
End Sub[\code]

This is in my July spreadsheet only. So is there a way to make it know which month spreadsheet to open on the 1st of the month? So come August 1st it will automatically open the August workbook and input the data for the first day? By using the date? Thanks so much

--
buzzharle
-----------------------------------------------------------------------
buzzharley's Profile: http://www.excelforum.com/member.php...fo&userid=3588
View this thread: http://www.excelforum.com/showthread.php?threadid=55947