The code i am using is as follows:
Sub MakeMonth()
Dim SH As Worksheet
Dim myDate As Variant
Dim D As Date, Y As Long
Set SH = ActiveSheet
myDate = InputBox(Prompt:="5/2/22", _
Default:=Format(Date, "mm/dd/yy"))
'If Y < 2000 Then Exit Sub
'If Y > 2100 Then Exit Sub
Application.ScreenUpdating = False
myDate = CDate(myDate)
'For D = DateSerial(Y, 1, 1) To DateSerial(Y, 12, 31)
For iCtr = DateSerial(Year(myDate), Month(myDate), 1) To DateSerial(Year(myDate), Month(myDate) + 1, 0)
Application.StatusBar = D
SH.Copy after:=Sheets(Sheets.Count)
'ActiveSheet.Range("A1").Value = D
ActiveSheet.Name = Format(iCtr, "mm dd yy")
Next
Application.StatusBar = False
Application.ScreenUpdating = True
End Sub
This code works fine for making a worksheet for everyday, however i only need every WORKDAY. I am new to VBA so i only understand the basics.
What do i need to adjust in the above code to make it only duplicate for workday?
Yes i know the answer is probably incredibly simple, but i can not figure it out.
Thank you for your help!!
Amber
Bookmarks