I have below code where we arrived at the list based on criteria and I have assigned it to an array called arr1. Now I am looking to apply a filter in "K" colum to select "Yes" alone loop through this array of items which are in "I" column and get the total sum from R column. I am fine if array is not to be used and we can loop through the list.
Sub Dcount()
Dim Lastrow As Long
Dim Rng As Range
Dim List As Object
Dim Listcount As Long
Dim arr1 as Variant
Lastrow = Cells(Rows.Count, "A").End(xlUp).Row
Set List = CreateObject("Scripting.Dictionary")
With Range("A1:I1")
.AutoFilter 1, "Temp", xlOr, "tem"
.AutoFilter 5, "MX"
End With
For Each Rng In Range("I2:I" & Lastrow).SpecialCells(xlVisible)
List(Rng.Value) = empty
Next Rng
ActiveSheet.AutoFilterMode = False
arr1 = Application.Transpose(Array(List.Keys, List.Items))
Sub Dcount()
Dim Lastrow As Long
Dim Rng As Range
Dim List As Object
Dim Listcount As Long
Dim arr1 as Variant
Lastrow = Cells(Rows.Count, "A").End(xlUp).Row
Set List = CreateObject("Scripting.Dictionary")
With Range("A1:I1")
.AutoFilter 1, "Temp", xlOr, "tem"
.AutoFilter 5, "MX"
End With
For Each Rng In Range("I2:I" & Lastrow).SpecialCells(xlVisible)
List(Rng.Value) = empty
Next Rng
ActiveSheet.AutoFilterMode = False
arr1 = Application.Transpose(Array(List.Keys, List.Items))