LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10
Default Macro to delete rows based on date

I have a spreadsheet with completion dates in column C. I want my macro to
look at each date, check to see if it's older than 30 days, and then delete
the rows that are older than 30 days. I have a macro that seems to work, but
I can't get it to loop (and I tried many times to make that happen). I'm
missing the loop piece, but also want to make sure I've put the "formula"
part in properly. Here's my macro:

Public Sub Delete1()
Range("c3").Select
If ActiveCell.Value <= "TODAY()-30" Then
ActiveCell.EntireRow.Delete
Else
ActiveCell.Offset(1, 0).Select
End If
End Sub

Thanks,
PMO
 
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
Delete Rows based on value Sabosis Excel Worksheet Functions 4 October 28th 08 11:21 PM
Delete Rows Based on Words Cue Excel Discussion (Misc queries) 2 June 4th 08 06:42 AM
Macro to delete rows based on a condition Darrilyn Excel Worksheet Functions 1 September 6th 07 12:12 AM
Delete rows based on criteria Chris_t_2k5 Excel Discussion (Misc queries) 2 April 11th 06 01:52 PM
Delete rows based on certain criteria Coal Miner Excel Discussion (Misc queries) 2 March 3rd 06 05:56 PM


All times are GMT +1. The time now is 01:50 AM.

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

About Us

"It's about Microsoft Excel"