Sheet tab date

T

Tom Ogilvy

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
 
B

boogie

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?.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top