I forgot to explain....sorry
alright..
these lines create the sheet and name it
Set xlWS = xlWB.Sheets.Add(, xlWB.Sheets(xlWB.Sheets.Count))
xlWS.Name = Format(CDate(I & "/01/" & Yr), "mmm YYYY")
it will ALWAYS create 12 month tabs for the Current Year
and Only a tab for each month of prev/next year that has data...
this is done in the IF statement
If (Yr <> Year(Date) And rs.EOF <> True) Or Yr = Year(Date) Then
if the Yr (Yr from loop) is Not = Year(Date) Current Year AND the Rs.EOF (EndOfFile) is Not true .. meaning it has records.. then allow it to create the sheet
OR
If the Yr is the Current Year (Year(Date)) then allow it
how I explained that well enough
Here is the BEST TIP you will get concerning working with excel
in excel.. record a macro of what you are trying to do... then look at the macro code
theres your code! (youwill need to tweak some things... but thats basically it)
also.. you can add a refernce to the MS Excel x.0 Object Library in access.. then programming for excel is easier.. you will get the intellisense dropdowns
Dim xls As Excel.Application
xls.[DROPDOWN]




sorry
Reply With Quote