VBA if statement help!

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

1 response

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