kirankoushik
New Member
- Joined
- Feb 19, 2021
- Messages
- 44
- Office Version
- 2016
- Platform
- Windows
Hello All,
I am trying to create a count for each item in the dictionary, where the values in 2 other columns are > 0
I am only getting the dictionary count as output each time. Please help me understand where I am going wrong.
Thanks
kiran
I am trying to create a count for each item in the dictionary, where the values in 2 other columns are > 0
I am only getting the dictionary count as output each time. Please help me understand where I am going wrong.
VBA Code:
dic.CompareMode = vbTextCompare
Set rRngVisible = Sheets("ScrewPoints").Range("A2").CurrentRegion
For Each rRow In rRngVisible.Rows
dic(rRow.Cells(2, 6).Value) = ""
Next rRow
Sheets("Total").Range("C40").Value = dic.Count
k = 0
For Each itm In dic
'rRngVisible.AutoFilter Field:=6, Criteria1:="5282 01"
'If Range(AG3 & AG) > 0 & Range(AH3 & AH) > 0 Then k = k + 1
'k = Application.CountIfs(Range("AG3:AG" & sLastRow), ">0", Range("AH3:AH" & sLastRow), ">0")
If (Sheets("ScrewPoints").Range("AG3:AH" & sLastRow).Value = 0) And _
(Sheets("ScrewPoints").Range("AH3:AG" & sLastRow).Value = 0) Then
k = k + 1
End If
Next itm
Sheets("Total").Range("C41").Value = k
k = 0
Thanks
kiran