macro for inserting rows based on dates

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

OK here's the problem:

I have a list of data with dates in column C.

I want to systematically insert two rows for every 7 days worth of data.
Here comes the tricky part...

There probably won't ACTUALLY be 7 days worth of data, there may only be 4
days or 5 days or however many days. I want it to look for a range of 7 day
periods and insert two rows between the records within the range.

Below is an example of what the data would look like before the macro.

A B C D E F G
10039999 Joe Smith 8/29/2003 Regular 7.5 10.06 75.45
10039999 Joe Smith 8/29/2003 Overtime 4.1 15.24 62.48
10039999 Joe Smith 8/30/2003 Regular 7.5 12.73 95.48
10039999 Joe Smith 9/1/2003 Holiday 7.5 12.73 95.48
10039999 Joe Smith 9/9/2003 Regular 7.5 12.73 95.48
10039999 Joe Smith 9/12/2003 Regular 7.5 12.73 95.48
10039999 Joe Smith 9/16/2003 Regular 3.5 12.73 44.56

So after the 7 day period of 8/24/03 - 8/30/03 it should insert two rows.
After the 7 day period of 8/31/03 - 9/6/03 it should insert two rows. After
the 7 day period of 9/7/03 - 9/13/03 it should insert two rows and so on.

Here's what it should look like after:
A B C D E F G
10039999 Joe Smith 8/29/2003 Regular 7.5 10.06 75.45
10039999 Joe Smith 8/29/2003 Overtime 4.1 15.24 62.48
10039999 Joe Smith 8/30/2003 Regular 7.5 12.73 95.48


10039999 Joe Smith 9/1/2003 Holiday 7.5 12.73 95.48


10039999 Joe Smith 9/9/2003 Regular 7.5 12.73 95.48
10039999 Joe Smith 9/12/2003 Regular 7.5 12.73 95.48


10039999 Joe Smith 9/16/2003 Regular 3.5 12.73 44.56

I hope this is explained clearly enough. Thanks in advance, you all are the
best!
 
Back
Top