View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.newusers
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default How do I set up 12 months/31 days each dated spreadsheets?

First, I agree with Gord. Don't do this. You're going to make it much more
difficult to analyze your data.

I'd do my best to put all the information in one worksheet. Add a column for
the date. You'll be able to use pivottables, charts, filters, subtotals...

All that stuff goes away if you separate your data onto different worksheets.

If you have to split it, can you use 12 worksheets and still use a column for
the date/day???

Option Explicit
Sub testme()
Dim FirstDate As Date
Dim LastDate As Date
Dim iDate As Date

FirstDate = DateSerial(2009, 1, 1)
LastDate = DateSerial(2009, 12, 31)

'just for testing, use a smaller finish date
LastDate = DateSerial(2009, 1, 5)

For iDate = LastDate To FirstDate Step -1
Worksheets.Add.Name = Format(iDate, "mmmm dd")
Next iDate

End Sub

ps. If I were doing this, I'd use a format of "yyyy-mm-dd". It would make
sorting the worksheets much easier.

pps. If you wanted to avoid Saturdays and Sundays, you could use something
like:

For iDate = LastDate To FirstDate Step -1
Select Case Weekday(iDate)
Case Is = vbSaturday, vbSunday
'skip it
Case Else
Worksheets.Add.Name = Format(iDate, "mmmm dd")
End Select
Next iDate

as that loop.



kayak99 wrote:

How do I add tabs and set up 12 months of (31 days each) dated spreadsheets?
I can delete any tabs of shorter months.

Thanks


--

Dave Peterson