Autofiltering trough every files sheet in a set path.

  • Hello, as title suggests I need help on implementing a Macro that would autofilter loop trough my files and their sheets in a set folder path. The action it would perform would:

    1. The first step would be to open the file and autofilter a table. The column it would autofilter from is the 11 (Field) column / the last column in the table.
      1. The criteria for the filtering would be this symbol: "-".
      2. The workbooks also contain sheets that don't have any tables so it would probably need also to ignore them or skip trough if no table is found.
    2. Following that it would move to next sheet and perform the same action until done with all the sheets in the workbook. When done move to next workbook until every (Around 50) Excel workbooks are done.

    This is for invoice attachments, so It's important there are no extra "empty rows" and that their filtered. This would save me so much time. I'm a beginner at this and would appreciate any help towards this project . Thank you in advance

    Here's some relevant code that could help. Maybe combing these to solves the problem (I've tested the for each tbl in .Listobjects, but it did not work:

    Code: Autofiltering code
    Sub Autofilter()
    ActiveSheet.ListObjects(1).Range.Autofilter Field:=10, Criteria1:="-"
    End Sub

Participate now!

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