Add Day of the Week to Worksheet

nniedzielski

Well-known Member
Joined
Jan 8, 2016
Messages
590
Office Version
  1. 2019
Platform
  1. 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.

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
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.

Forum statistics

Threads
1,214,383
Messages
6,119,198
Members
448,874
Latest member
Lancelots

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top