OK, pretty close to what I want, thank you. I have not used VBA before, but
I have managed to make some changes in order to have the first sheet
starting at April 30 - May 6, the second sheet needs to May 7 - 13, then May
14 - 20, etc. The closest I could get was:
Public Sub RenameByWeeks()
Dim vResult As Variant
Dim dFirstDate As Double
Dim i As Long
Do
vResult = Application.InputBox( _
Prompt:="Enter year:", _
Type:=1, _
Title:="Rename Worksheets by weeks", _
Default:=Year(Date) + 1)
If vResult = False Then Exit Sub 'user cancelled
Loop Until (vResult > 1904) And (vResult <= 9999)
dFirstDate = DateSerial(2007, 4, 29)
dFirstDate = dFirstDate - Weekday(dFirstDate) + 2
With ActiveWorkbook.Worksheets
.Item(1).Name = "Apr 30-" & Format(dFirstDate + 6, "d")
For i = 2 To .Count
dFirstDate = dFirstDate + 7
.Item(i).Name = Format(dFirstDate + 1, "mmm d\-") & _
Format(dFirstDate + 7, "d")
Next i
End With
End Sub
This gives me Apr 30 - May 6, May 8 - 14, May 15 - 21, etc. (just a little
off...
RD