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