I want to make a macro that will be summing the non blank in a column range (and I want it to loop in a column's array) and show the output in the top row (row 12).
I used this post Sum range-loop in VBA but couldn't apply for my case.
So far I've done this:
Sub Count_blanks()
Dim arrControlSheet As Variant
Dim SumErrors As Integer
Dim TtlErrors As Double
Dim h As Long
arrControlSheet = Array("D", "E", "F", "G", "H", "I", "J", "K", "L")
For h = LBound(arrControlSheet) To UBound(arrControlSheet)
With Sheets("Control")
TtlErrors = Cells(12, arrControlSheet(h)) = Application.CountA(Range(Cells(13, arrControlSheet(h)), Cells(80, arrControlSheet(h))))
.Range(arrControlSheet(h) & 12) = TtlErrors
End With
Next
End Sub
Please see the below screenshot to have better visualization:
The macro is supposed to update the row 12, indicating the number of non-blank cells in that respective column (from row 13 to 80).
Thank you very much

TtlErrors = Application.CountA(Range(Cells(13, arrControlSheet(h)), Cells(80, arrControlSheet(h))))? You have two equals signs in that line.