I have a macro that duplicates a worksheet however many times you want, but I want to be able to rename those sheets. I would like to name them the dates of the month. I do not know if there is a way to do that, and to do it with weekdays only.
I have the following macro that I've cobbled together from a couple different locations, maybe someone can iron it out for me. I was just going to have the macro pull names from a list, and have a list of the dates on a hidden page, but excel saves the dates in a format that won't transfer to worksheet name.
![]()
Sub namesheets() Dim arr As Variant arr = Range(& "-" & Month(Range("Dates!a2:Dates!a30")) & "-" & Day(Range("Dates!a2:Dates!a30")) & "-" & Year(Range("Dates!a2:Dates!a30"))).Value For i = LBound(arr) To UBound(arr) Sheets(i + 1).Activate Sheets(i).Name = arr(i, 1) Next i End Sub
Bookmarks