Godders199
Active Member
- Joined
- Mar 2, 2017
- Messages
- 313
- Office Version
- 2013
Hi, can anyone tell me what I am doing wrong here, I keepgetting the following error “Unable to get the countifs property of theworksheetfunction class
Dim lastrowcolumnz As Long
lastrowcolumnz = Range("a" &Rows.Count).End(xlUp).Row
For i = 2 To lastrowcolumnz
Cells(i, 20) =Application.WorksheetFunction.CountIfs(Sheets("HomeInsurance").Range("B:B"), Sheets("Summary").Cells(i,1) > 0, Cells(i, 20).Value = "Home Insurance", "")
Next i
If I type the formula in the cell it returns the results,just can get the vba code to work.
Have looked at loads of examples, just cant get past thiserror
thanks
Dim lastrowcolumnz As Long
lastrowcolumnz = Range("a" &Rows.Count).End(xlUp).Row
For i = 2 To lastrowcolumnz
Cells(i, 20) =Application.WorksheetFunction.CountIfs(Sheets("HomeInsurance").Range("B:B"), Sheets("Summary").Cells(i,1) > 0, Cells(i, 20).Value = "Home Insurance", "")
Next i
If I type the formula in the cell it returns the results,just can get the vba code to work.
Have looked at loads of examples, just cant get past thiserror
thanks