Please help with macro code to delete rows where the date is less than a date I enter into a cell. As you can see my dataset has a header row.
Currently in cell A1 is the word "Date", it is formatted as General.
In cell A1 I will enter a date such as 26-Aug-16.
I would like for a macro to add 1 day to the date I entered making it 27-Aug-16
then, scan down the rest of the sheet starting on row 2 and delete any row where the date is less than the date in cell A1(27-Aug-16).
My worksheet will probably always contain less than 100 rows of data.
Hope that made sense. Thanks
Excel 2012
<tbody>
</tbody>
Currently in cell A1 is the word "Date", it is formatted as General.
In cell A1 I will enter a date such as 26-Aug-16.
I would like for a macro to add 1 day to the date I entered making it 27-Aug-16
then, scan down the rest of the sheet starting on row 2 and delete any row where the date is less than the date in cell A1(27-Aug-16).
My worksheet will probably always contain less than 100 rows of data.
Hope that made sense. Thanks
Excel 2012
A | B | C | D | |
---|---|---|---|---|
1 | Date | Material | Material Desc | Production Line |
2 | 16-Aug-16 | 1000001 | Blue Coat | 1 |
3 | 17-Aug-16 | 1000002 | Yellow Hat | 3 |
4 | 18-Aug-16 | 1000003 | Red Jacket | 5 |
5 | 18-Aug-16 | 1000004 | Blue Coat | 7 |
6 | 18-Aug-16 | 1000005 | Yellow Hat | 3 |
7 | 19-Aug-16 | 1000006 | Red Jacket | 2 |
8 | 20-Aug-16 | 1000007 | Blue Coat | 4 |
9 | 20-Aug-16 | 1000008 | Yellow Hat | 2 |
10 | 21-Aug-16 | 1000009 | Red Jacket | 6 |
11 | 22-Aug-16 | 1000010 | Blue Coat | 8 |
12 | 22-Aug-16 | 1000011 | Yellow Hat | 4 |
13 | 22-Aug-16 | 1000012 | Red Jacket | 2 |
14 | 23-Aug-16 | 1000013 | Blue Coat | 5 |
15 | 23-Aug-16 | 1000014 | Blue Coat | 4 |
16 | 24-Aug-16 | 1000015 | Yellow Hat | 5 |
17 | 25-Aug-16 | 1000016 | Red Jacket | 4 |
18 | 26-Aug-16 | 1000017 | Blue Coat | 5 |
19 | 27-Aug-16 | 1000018 | Yellow Hat | 3 |
20 | 27-Aug-16 | 1000019 | Red Jacket | 3 |
21 | 28-Aug-16 | 1000020 | Blue Coat | 1 |
22 | 28-Aug-16 | 1E+09 | Yellow Hat | 1 |
<tbody>
</tbody>
Test
Last edited: