Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Here is what I came up with that seems to be working:
Dim ArchiveDate As Date Dim LastRow as Long 'Calculate date to delete rows, E25=This week saturday date, J16=Number of weeks to go back ArchiveDate = ThisWorkbook.Sheets("Settings").Range("E25").Value - _ (ThisWorkbook.Sheets("Settings").Range("J16").Valu e * 7) LastRow = Sheets("Archive").Cells(Sheets("Archive").Rows.Cou nt, "A").End(xlUp).Row + 1 With Sheets("Archive") 'Data starts at row 6 Do While LastRow 5 If .Range("A" & LastRow).NumberFormat = "d-mmm-yy" Then If .Range("A" & LastRow).Value <= ArchiveDate Then MsgBox ("Got a hit") Rows(LastRow).Delete End If End If LastRow = LastRow - 1 Loop End With What do you think? Thanks for the sugestion to comapre the format, that is the answer to this problem. Cheers. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How can I generate a list of random dates from dates I specify | Excel Worksheet Functions | |||
How to filter out all the partial dates from a big list of dates? | Excel Discussion (Misc queries) | |||
Counting dates, within a list of dates | Excel Worksheet Functions | |||
Need to pull current dates from list w/many dates | Excel Discussion (Misc queries) | |||
need to convert list of dates to count no. of dates by week | Excel Worksheet Functions |