nniedzielski
Well-known Member
- Joined
- Jan 8, 2016
- Messages
- 590
- Office Version
- 2019
- Platform
- Windows
I am creating a worksheet for each day of the week based on the min date of a column. Right now the sheets are named as the date in the following format "dd-mmm"
I would like the day of the week to be added to this date as such "Tues dd-mmm"
Here is the code, many thanks to Joe4 who helped me with this loop.
I would like the day of the week to be added to this date as such "Tues dd-mmm"
Here is the code, many thanks to Joe4 who helped me with this loop.
Code:
Dim i As IntegerDim minDate As Date
Dim wsName As String
minDate = Application.Min(Range("D:D")) 'to find earliest date on the board
' create 7 sheets based on minDate
For i = 0 To 6
wsName = Format(minDate + i, "dd-mmm")
Sheets.Add after:=Sheets(Sheets.Count)
Sheets(Sheets.Count).Name = wsName
Next i