dave
01-20-2011, 08:23 AM
I have a routine (pretty much strait from the book) that loops through the filters
For Each objFilter In datasource.Filters 'objFiltersCollection
If objFilter.Name = myFilter Then
If Not objFilter.Criteria Is Nothing Then
If objFilter.Criteria.Count >= 1 Then
i = 1
MyIndex = objFilter.Criteria.Item(1).ValueAttribute
FindCodeList datasource, MyIndex, myIndexOut
ThisWorkbook.Worksheets("Sheet1").Activate
Cells(i, 1).Value = "Filter item type = " & objFilter.ItemType & Space(20 - Len(objFilter.ItemType)) _
& "Filter name = " & objFilter.Name & " " _
& objFilter.Criteria.Item(1).SourceAttributeName _
& objFilter.Criteria.Item(1).Operator _
& myIndexOut
i = i + 1
End If
End If
End If
Next
When I find the correct filter name here
For Each objFilter In datasource.Filters 'objFiltersCollection
If objFilter.Name = myFilter Then
If Not objFilter.Criteria Is Nothing Then
If objFilter.Criteria.Count >= 1 Then 'I need to loop through the filter criteria now
Instead of just saying "if the count is > 1 then", I need to loop through the filter criteria. What does that look like?
Thanks!
For Each objFilter In datasource.Filters 'objFiltersCollection
If objFilter.Name = myFilter Then
If Not objFilter.Criteria Is Nothing Then
If objFilter.Criteria.Count >= 1 Then
i = 1
MyIndex = objFilter.Criteria.Item(1).ValueAttribute
FindCodeList datasource, MyIndex, myIndexOut
ThisWorkbook.Worksheets("Sheet1").Activate
Cells(i, 1).Value = "Filter item type = " & objFilter.ItemType & Space(20 - Len(objFilter.ItemType)) _
& "Filter name = " & objFilter.Name & " " _
& objFilter.Criteria.Item(1).SourceAttributeName _
& objFilter.Criteria.Item(1).Operator _
& myIndexOut
i = i + 1
End If
End If
End If
Next
When I find the correct filter name here
For Each objFilter In datasource.Filters 'objFiltersCollection
If objFilter.Name = myFilter Then
If Not objFilter.Criteria Is Nothing Then
If objFilter.Criteria.Count >= 1 Then 'I need to loop through the filter criteria now
Instead of just saying "if the count is > 1 then", I need to loop through the filter criteria. What does that look like?
Thanks!