Thread: Sheet tab date
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Sheet tab date

Sub NameTabs()
Dim dtValue as Date, dt1 as Date
Dim dt2 as Date
Dim i as long, sh as Worksheet
dtValue = DateValue("August 11, 2003")
i = 0
for each sh in ThisWorkbook.worksheets
dt1 = dtValue + 7 * i
dt2 = dtValue + 7 * i + 5
if month(dt1) = month(dt2) then
sh.name = Format(dt1,"mmmm dd") & "-" _
& format(dt2,"dd")
else
sh.name = Format(dt1,"mmmm dd") & "-" _
& format(dt2,"mmmm dd")
End if
i = i + 1
Next

End Sub

--
Regards,
Tom Ogilvy



boogie wrote in message
...
hello,
I am trying to make a one year lesson plan for my class. The first
sheet tab's name is August 11-15. Is there a code or a formula to make the
next sheet tab go August 17-21 (skips saturday and sunday) and so on until
the end of the school year?.