Auto FIltering with VBA

  • Essentially I am trying to filter Column Z by the months shown in cells B2:B4 upon the click of a button. So let's say that I have May through July showing in Cells B2:B4, once I click a button I want to Auto Filter Column Z to show only the rows that have dates between May and July. I know I could just use the normal filters, however, by doing it through VBA I am thinking that it will not matter which months are showing in B2:B4 and will pull the appropriate data. It sounds simple enough but I am clearly missing something, I have tried a multitude of things across the web and have had no luck so far. Not sure if it matters but I did use a table.

    If you need any more information let me know.

    Any help would be greatly appreciated.

    Thank you,

  • Which columns does the table occupy? This code assumes the table is in columns V:AA, so column Z is the 5th column (hence the Field:=5 in the code).

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!