VBA to delete rows older than 14 days

Occasional Contributor



Who can help me with the following.

I have a list of users. New users are being added daily to the list. Old users that have been added 14 days ago must be deleted.


Is there some smart solution to delete these users by applying VBA code?


Kind regards,


2 Replies
best response confirmed by Guram_Bregadze (Occasional Contributor)

Hi @Guram_Bregadze 


(I don't do VBA) Assuming you run Excel 2021 or 365, an alternative:


Sans titre.png

in E4:

=FILTER(TableUsers, TableUsers[Date Added] >= TODAY()-14)


Hello @L z.

Thank you for your efforts, but I need more like VBA solution to attach a button to it.

Best regards,