Hi there,
The code below displays / outputs a list all dates between a specified starting and ending date input by the user.
However, I'm having a bit of trouble only listing WORKDAYS (Monday through Friday).
An added BONUS would be to also eliminate Holidays from the list.
Any advice or assistance would be GREATLY appreciated!
The code below displays / outputs a list all dates between a specified starting and ending date input by the user.
However, I'm having a bit of trouble only listing WORKDAYS (Monday through Friday).
An added BONUS would be to also eliminate Holidays from the list.
Any advice or assistance would be GREATLY appreciated!
Code:
Sub Date_Generator()
'Create some VARIABLES.
Dim Start_Date As Date
Dim End_Date As Date
Dim Next_Date As Date
'Set the Column Width.
Columns("A:C").ColumnWidth = 20
'Assign some VALUES.
Start_Date = Range("B1").Value
End_Date = Range("B2").Value
Next_Date = Start_Date
'Set the OUTPUT Destination.
Range("C1").Select
'Set the PARAMETERS of the DATE RANGE.
Do Until Next_Date >= End_Date
ActiveCell.Value = Next_Date
ActiveCell.Offset(1, 0).Select
Next_Date = Next_Date + 1
'Tell it to INCREMENT
Loop
End Sub
Last edited: