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


I meant
Code
-------------------
Private Sub Workbook_Open()
If DatePart("m", Date) = "1" Then
Workbook("2006-Jan-Sales").select
ElseIf DatePart("m",Date) = "2" Then
Workbook("2006-Feb-Sales").select
'through the twelve months
End If
End Sub
-------------------


The file is way to big or else I would upload it here. The data i
imports is from a Comm2000 cash register. Every night the compute
pulls the sales info from the register to a Data folder-- it's called
.dat file? The excel macros grab the info from the dat file and put i
into the right cells like- visa, mastercard, pizza sales, pasta sales.
Each month is a new workbook. So in the example above I meant to writ
workbook not sheet!! Sorry about the confusion!

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