Sub deleterows()
Dim lastrow as Long, i as Long
set lastrow = cells(rows.count,1).End(xlup).row
for i = lastrow to 1 step -1
if cells(i,1).value = cells(i,2).value and cells(i,3).value = "delete"
then
rows(i).delete
end if
Next
End Sub
--
Regards,
Tom Ogilvy
"FIRSTROUNDKO via OfficeKB.com" wrote:
HI!
I am loooking fo a macro that will delete 2 rows based a delete being in the
2nd row and the data in col A ans B being the same.
i.e before
Car Bus net 1 USD
Car Bus delete NOFAIR
Car Train net 2 USD
Plane Walking net 5 USD
Plane Bus delete NOFAIR
after
Car Train net 2 USD
Plane Walking net 5 USD
Plane Bus delete NOFAIR
Thanks in Advance
Darren
--
Message posted via http://www.officekb.com