Reputation: 3299
I have set filters on field 20 ,9 and 15
With dsWrksheet.Range("T1")
.AutoFilter Field:=20, Criteria1:="=*" & Id & "*"
.AutoFilter Field:=9, Criteria1:="Controls Solutions"
.AutoFilter Field:=15, Criteria1:="India"
End With
After the filter is set I am calculating the sum of values in visible cells of column AB like this
Set myRange = dsWrksheet.Range("AB1:AB" & dsWrksheet.Range("AB" & Rows.count).End(xlUp).Row)
voucherValInd = WorksheetFunction.Sum(myRange.SpecialCells(xlCellTypeVisible))
The problem is arising when the cells are empty I am getting wrong values as sum.
Help is appreciated.
Upvotes: 0
Views: 475