coloradomtns
New Member
- Joined
- Apr 14, 2016
- Messages
- 5
Hello all,
I am stuck on an autofilter issue. I am trying to add criteria to an existing filtered column named "Interval".
I have an Excel table with a column containing string or numeric data (see table below).
I need to filter and return all records that are contained in the array (note I do not need to use an array).
The code below only returns records with B1 and 7.
<tbody>
</tbody>
Here is my code that I'm currently using below. It only returns B1 and 7 - need to see all records containing 6A, B1, and 7.
=========================
Sub Macro5()
Dim i As Long, arr As Variant
arr = Array("6A", "B1", "7")
ActiveSheet.Range("A1:A15").AutoFilter field:=1, Criteria1:=arr, Operator:=xlFilterValues
End Sub
Thanks!
I am stuck on an autofilter issue. I am trying to add criteria to an existing filtered column named "Interval".
I have an Excel table with a column containing string or numeric data (see table below).
I need to filter and return all records that are contained in the array (note I do not need to use an array).
The code below only returns records with B1 and 7.
Interval |
A1,B1 |
7,8 |
B1 |
A1,C1 |
2,3,4 |
6A,6E,6F |
A1,B1,2,3,4,5 |
6A,6B,6C |
A1,B1,2,3,4,5,6,7,8 |
7 |
2,3,4 |
2 |
5,6A,6E,7,8 |
5 |
<tbody>
</tbody>
Here is my code that I'm currently using below. It only returns B1 and 7 - need to see all records containing 6A, B1, and 7.
=========================
Sub Macro5()
Dim i As Long, arr As Variant
arr = Array("6A", "B1", "7")
ActiveSheet.Range("A1:A15").AutoFilter field:=1, Criteria1:=arr, Operator:=xlFilterValues
End Sub
Thanks!