Unable to get Countifs property of the function class error

Drawleeh

New Member
Joined
Sep 2, 2021
Messages
34
Office Version
  1. 2016
  2. 2010
Platform
  1. Windows
Hello, I am getting the aforementioned error with my code, and I have absolutely no clue why. Any help would be appreciated I'm clearly not understanding something.

VBA Code:
[CODE=vba]Sub MonthlyAdd()
Dim Category(7 To 10) As Variant
Dim Ar As Variant
Dim Br As Variant
Dim Catgry As String
Dim i As Long
Dim k As Long
Dim Comp As Variant
Dim tot As Long
Dim item As Variant


For k = 2 To 13



Ar = Worksheets("Log").Cells(k, 6).Value2



Br = Application.WorksheetFunction.EoMonth(Worksheets("Log").Cells(k, 6), 0)

For i = 7 To 10



Category(i) = Worksheets("Log").Cells(1, i).Value

Catgry = Category(i)

With Worksheets("Log")
    Cells(k, i) = Application.WorksheetFunction.CountIfs( _
    .Range("C3", .Range("C3").End(xlDown)), "=" & Catgry & "*", _
    .Range("A3", .Range("A3").End(xlDown)), ">=" & Ar, _
    .Range("A3", .Range("A3").End(xlDown)), "<=" & Br)
End With

Next i


Next k

End Sub
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Not sure...do you need to add the value property, for example:
Cells(k, i).value = Application.WorksheetFunction.CountIfs( _
 
Upvote 0
A reminder:

Cross-posting (posting the same question in more than one forum) is not against our rules, but the method of doing so is covered by #13 of the Forum Rules.

Be sure to follow & read the link at the end of the rule too!

Cross posted at:
If you have posted the question at more places, please provide links to those as well.

If you do cross-post in the future and also provide links, then there shouldn’t be a problem.
 
Upvote 0

Forum statistics

Threads
1,223,710
Messages
6,174,019
Members
452,542
Latest member
Bricklin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top