I am running a code that filters a large set of data and puts that data into a new file and manipulates it.
I would like to add a few lines to this code that store the filters that do NOT give any data.
For example:
In this case, Filter2 is the next filter (Which would filter for the Criteria B in the same column).
How do I institute a line of code that would, at the end of the entire process, tell me which items yielded no filtered results? It would me a MsgBox saying
"The following items returned no filter results: A, C, G"
OR
"The following items returned no filter results:
A
C
G"
I would much prefer the second one since the filters aren't A,B,C, etc. but rather large strings of text.
Thanks!
I would like to add a few lines to this code that store the filters that do NOT give any data.
For example:
Code:
'Filters column V to only one criteria
ActiveSheet.Range("$A1:$Y" & RowCount).AutoFilter Field:=22, Criteria1:= _
"A"
'If filter yields no results, go to next filter
If Range("$A1:A" & RowCount).SpecialCells(xlCellTypeVisible).Count = 1 Then
GoTo Filter2
End If
In this case, Filter2 is the next filter (Which would filter for the Criteria B in the same column).
How do I institute a line of code that would, at the end of the entire process, tell me which items yielded no filtered results? It would me a MsgBox saying
"The following items returned no filter results: A, C, G"
OR
"The following items returned no filter results:
A
C
G"
I would much prefer the second one since the filters aren't A,B,C, etc. but rather large strings of text.
Thanks!
Last edited: