VBA if statement help!

Closed
PM - Mar 10, 2011 at 09:24 AM
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 - Mar 10, 2011 at 12:21 PM
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 response

rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 766
Mar 10, 2011 at 12:21 PM
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
0