If DatePart("m", Date) = "1" Then
Sheets("Jan").select ' or however you have named the January sheet
elseif DatePart("m",Date) = "2" then
Sheets("Feb").select
'through the twelve months
end if
Best wishes,
Jim
"buzzharley" wrote:
>
> So I have Monthly sales sheets that import my cash register data into
> 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 the
> macro to import the data into the correct day of the month. Here is the
> 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.
>
>
> --
> buzzharley
> ------------------------------------------------------------------------
> buzzharley's Profile: http://www.excelforum.com/member.php...o&userid=35886
> View this thread: http://www.excelforum.com/showthread...hreadid=559474
>
>
Bookmarks