I have a sample worksheet (and other alike worksheets with similar pattern of data) in a workbook, but row data could vary from 3 days to 15 days spanning across rows of 500 to 20000 to 50000 rows. Worksheet has just hard coded data and no formula.
Row data could vary in each worksheet but key identifier would be Date in Column O (Column No. 15), Date format dd-mmm-yy and always sorted on date sequentially. Row 1 in each worksheet is Header, which should never be deleted / disturbed
Based on date contained in Cell O2 (O1 acts like Column Header) , I want a macro which could read date always from Cell O2, filter on that date, and delete all rows based on that date, including Row 2 (O2) in fastest possibly manner. I was trying something with
Now how to pass date from cell O2 which is date in format dd-mmm-yy to some variable and filter on that column, and delete all rows where similar date appears in column O, including Row 2 (Cell O2). After deleting such rows, filter should be removed.
I guess With …..Ranges End With, would slow down the process, as in some worksheet, rows could be as high upto more than 50000
A Sample workbook containing row data upto 487 rows with 3 dates, 10-May-17, 11-May-17, and 12-May-17 is attached, and wish to delete all data having 10-May-17 (reading from Cell O2), including row 2, such that, Header in Row1 will remain intact, and data only for 11-May-17, and 12-May-17 will remain.
Thanks
Bookmarks