LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 126
Default Managing list using dates!

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I generate a list of random dates from dates I specify JJ TUMIA Excel Worksheet Functions 2 August 8th 08 12:23 PM
How to filter out all the partial dates from a big list of dates? Tiwarr Excel Discussion (Misc queries) 1 September 14th 06 05:35 PM
Counting dates, within a list of dates jrheinschm Excel Worksheet Functions 7 April 19th 06 06:13 PM
Need to pull current dates from list w/many dates mcilpuf Excel Discussion (Misc queries) 4 February 20th 06 09:05 AM
need to convert list of dates to count no. of dates by week neowok Excel Worksheet Functions 13 January 30th 06 03:54 PM


All times are GMT +1. The time now is 11:38 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"