VBA insert 1 row bellow cells within 90 days of date

  • Hello All:


    I am looking for some much needed help on resolving an issue.


    I would like a macro that loops through my rows, and inserts 1 row below the cell that is within 90 days of a cell value.


    A7 = cell value being referenced


    Column C has the dates in my spreadsheet. My range starts at row 9.


    Any advice would be extremely appreciated


    Thank you :)

  • When you say 90 days do you mean lets say your data range starting C9 in the sheet is from 1-JAN-2017 to 31-DEC-2017. Your Criteria in A7 is 1-JUN-2017.


    So when you say 90 Days do you mean 90 days from 1-JUN onwards (3 months ahead) or do you mean 90 days +/- 1-JUN (3 month back & 3 months ahead)
    Secondly is 1-JUN be counted as day 1? because if we count 1-JUN as day 1, then 29-AUG is 90th day; but if count starts on next day then 30-AUG is 90th day.

  • code for both scenarios below

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!