VBA if statement help!

[Closed]
Report
-
Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
-
Hello,

I need some help with doing the following in vba:

If column F has a date which equals zero then delete.

If column F has a date which is less then 2 years in the future then delete. (e.g less then March 2013)

If column F has a date greater then 10 years in the future then delete. (e.g greater then March 2021)

Hope someone can help!

Thanks in advance!

Excel 2003

1 reply

Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
768
Actually i think you can filter the rows by looking for date < or date >
this should show you all rows that you want to delete
then delete it

if you want to do via macro, do it manually and record your action to get the macro