Link to home
Start Free TrialLog in
Avatar of SMP319
SMP319Flag for United States of America

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

Avatar of nutsch
nutsch
Flag of United States of America image

Can you attach the file?
Avatar of SMP319

ASKER

Thought I did. Here it is
Auto-Fill-Example.xlsm
Avatar of Rob Henson
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
SOLUTION
Avatar of nutsch
nutsch
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of SMP319

ASKER

Nutsch. Can you update the code to select a specific cell instead of just Selection?
Avatar of SMP319

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

Open in new window