SMP319
asked on
Fill Dates series by week based on Entered Staret and End date.
I am looking for a code to enter dates into a column based on dates entered in Start and End Date Cells. The dates will need to be the friday date for every week.
Sample File attached. this needs to be automated. not the simple fill in the next date and use the auto fill option in excel
Thanks
Sample File attached. this needs to be automated. not the simple fill in the next date and use the auto fill option in excel
Thanks
Can you attach the file?
ASKER
Thought I did. Here it is
Auto-Fill-Example.xlsm
Auto-Fill-Example.xlsm
Formula in E4:
=IF(E3="","",IF(E3+7>$B$4, "",E3+7))
Where E3 is start date (linked to B3 if required) and B4 is finish date.
Fill down as many rows as required, when beyond finish date result will be blank.
Thanks
Rob H
=IF(E3="","",IF(E3+7>$B$4,
Where E3 is start date (linked to B3 if required) and B4 is finish date.
Fill down as many rows as required, when beyond finish date result will be blank.
Thanks
Rob H
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Nutsch. Can you update the code to select a specific cell instead of just Selection?
ASKER
Thanks to all for the quick response
Yes
Sub AutofillDates()
'
' AutofillDates Macro
'
Dim dtStart As Date, dtEnd As Date
dtStart = [b3]
dtEnd = [b4]
with cells(3,"E")
.Value = dtStart
.Offset(1) = dtStart + 7
.Resize(2).AutoFill Destination:=Range(.cells(1,1), .cells(1,1).Offset((dtEnd - dtStart) / 7)), Type:=xlFillDefault
end with
End Sub