Would really appreaciate a friendly nudge to the right direction.
I am trying to use an array as a variable to populate a column with values based on COUNTIFS formula, like "a cell - a formula with new element of the array as a variable". So AF2 - Countifs for Brand2 AF3 - Countifs for Brand3 .. Now I get the value ONLY for the final element of the array (and I can see how excel loops through the rest) for the whole range. Tried more or less everything known to me and looked through earlier questions - to no avail. Would appreciate a little help.

Option Explicit
Sub Summa_po()
Dim Mesyaz1 As Date
Dim Mesyaz2 As Date
Dim Mesyaz3 As Date
Dim Brand()
Dim i As Long
Worksheets(1).Activate
Mesyaz1 = DateAdd("m", -1, Now)
Mesyaz2 = DateAdd("m", -2, Now)
Mesyaz3 = DateAdd("m", -3, Now)
Brand = Array("Brand1", "Brand2", "Brand3", "Brand4")
For i = LBound(Brand) To UBound(Brand) 'Here I tried also For i=0 to UBound(Brand)
With ActiveSheet.Range("AF:AF")
.Formula = "=COUNTIFS(C:C," & RTrim(Month(Mesyaz3)) & ",H:H,""Head"",F:F," & Chr(34) & Brand(i) & Chr(34) & ")"
.AutoFill Destination:=ActiveSheet.Range("AF2:AF55") 'I used to draw it to the last cell but it is not a problem appararently
End With
Next i
[AF1] = "Head"
End Sub
StopbeforeEnd Withand check the formulas when code stops. You will see that it uses the second array element (for the first you have to use 0) and then the third one. The previous formulas will be replaced by that last iteration... How do you like tho formulas to really look?=COUNTIFS(C:C,12;H:H,"Head",F:F,"Brand1") + COUNTIFS(C:C,12,H:H,"Head",F:F,"Brand2") + COUNTIFS(C:C,12,H:H,"Head",F:F,"Brand3") + COUNTIFS(C:C,12,H:H,"Head",F:F,"Brand4")