filtering rows of a spreadsheet
'i'm creating a filter for a spreadsheet with 2 sets of dates. 1 date is the
bill date, and the other is the calculation date. wherever there is a duplicate bill date, the older of the calculation dates must be removed. 'i'm new to this, and my code doesnt work properly, but i'm trying to get one thing to work at a time: Sub filter() Dim X, Y As Integer Dim billdate1, billdate2 X = 5 'the "Date" column. Y = 2 'start of the data. Do Until Cells(X, Y).Value = "" 'this should loop until the end of the data is reached billdate1 = Cells(X, Y).Value 'i'm not sure what happens with a cell value formatted as a date - is this going to work? billdate2 = Cells(X, Y + 1).Value If billdate1 = billdate2 Then If Cells(X + 1, Y).Value Cells(X + 1, Y + 1).Value Then 'this has to remove the earlier of the 2 calc. dates and then go back to the same row of data to test the next row against the result Else 'same deal End If End If Y = Y + 1 Loop End Sub all help is appreciated. |
All times are GMT +1. The time now is 11:34 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com