holland3777
Technical User
I was wondering if there is a way to calculate every friday in a year using VB and place those dates on the sheet tab as names?
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Sub AddSheets()
Application.ScreenUpdating = False
FirstFriOfYear = "[red]01/07/05[/red]" [green]'Change date to the first Fri of any year[/green]
myYear = Year(FirstFriOfYear)
ActiveSheet.Name = Format(FirstFriOfYear, "mm-dd-yy")
Do
LatestDate = DateValue(ActiveSheet.Name)
Sheets.Add Type:="Worksheet"
ActiveSheet.Name = Format(LatestDate + 7, "mm-dd-yy")
NmbrShts = ActiveWorkbook.Sheets.Count
ActiveSheet.Move After:=Sheets(NmbrShts)
Loop Until DateValue(ActiveSheet.Name) >= DateValue("12-31-" & myYear)
Application.ScreenUpdating = True
End Sub