I get a \"Unable to get the Countif property of the Worksheetfunction class\" error when using this code
Windows(\"usertemp.xls\").Activate Selection.AutoFil
CounIf does not accept a multi-area range. You need to loop over the Areas:
CounIf
Areas
Dim impats As Long, r As Range For Each r In Range("AL:AL").SpecialCells(xlCellTypeVisible).Areas impats = impats + WorksheetFunction.CountIf(r, "I") Next