Macro help-automatically delete rows based on cell values

mlhwhite007

New Member
Joined
Oct 26, 2006
Messages
1
I’m creating a macro to reformat data in a report. I would like to create a loop in the code that looks for a specific value listed in column F and compares it to a corresponding date in column G to determine whether or not to delete the row.

For example: If F6 equals “Interview-Rejected”, and G6 (date) is greater than system date plus 7 days, then delete row 6. This loop should run until it gets to a blank row in Column F.

Thanks!
 

Some videos you may like

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).

Jonmo1

MrExcel MVP
Joined
Oct 12, 2006
Messages
44,061
I'm sure someone will find an easier way, but here goes...

add a collumn with the following formula filed down...
=IF(g2>TODAY()+7,"TRUE")


Now just manually record a macro that will use autofilter to filter collumn F by "Interview-Rejected" AND filter collumn X by TRUE. Then delete all rows.
 

Watch MrExcel Video

Forum statistics

Threads
1,109,518
Messages
5,529,311
Members
409,862
Latest member
lbisacca
Top