I am trying to use AdvancedFilter in VBA to create an export of a list. My issue is not with the code, which works, but with the criteria I am trying to use. I want to filter on values that are a SUMIF of the RAW dataset I am using. So, if on the RAW data =sumif(m:m,a:a,a2)<2, then exclude from the list. How would I put this in a my criteria (Range a1:a2)? Is the only solution to make a new column in my raw dataset that contains the sumifs formula and then base a criteria off of that?
Code for reference
FilterData()
Sheets("RAW").Range("A1:n2000").AdvancedFilter Action:=xlFilterCopy, CriteriaRange:= _
Sheets("Criteria").Range("a1:a2"), CopyToRange:=Sheets("EXPORT").Range("A1:n1"), Unique:=True
Columns.AutoFit
Cells.WrapText = False
End Sub