wsnyder
Board Regular
- Joined
- Sep 23, 2018
- Messages
- 223
- Office Version
- 365
- Platform
- Windows
Hi all,
Using excel 365.
AutoFilter uses a Criteria Array, but only returning data for one of the elements of the array, nothing for the 2nd element.
I added a debug.print command to check the Array and both items are returned.
I reviewed the data and there are records in the data that match both array elements.
I am transferring a Range to the Array in case that might be the issue.
I tested the contents of the array. The contents are correct
Here is the AutoFilter snippet. It is only returning records that match the first element of the criteria array
Thanks,
-w
Using excel 365.
AutoFilter uses a Criteria Array, but only returning data for one of the elements of the array, nothing for the 2nd element.
I added a debug.print command to check the Array and both items are returned.
I reviewed the data and there are records in the data that match both array elements.
I am transferring a Range to the Array in case that might be the issue.
VBA Code:
'Transfer criteria range to criteria array
arr = rngCriteria
I tested the contents of the array. The contents are correct
VBA Code:
For i = LBound(arr) To UBound(arr)
Debug.Print i, arr(i, 1)
Next i
Here is the AutoFilter snippet. It is only returning records that match the first element of the criteria array
VBA Code:
lo.Range.AutoFilter _
Field:=5, _
Criteria1:=arr, _
Operator:=xlFilterValues
Thanks,
-w