Hi all friends and experts,
I would like to ask your support,
I have some data, need to add VBA COUNTA formula, by count row in column D
also show CountA formula in the cell
Screenshot 2022-05-21 143338.png
Hi all friends and experts,
I would like to ask your support,
I have some data, need to add VBA COUNTA formula, by count row in column D
also show CountA formula in the cell
Screenshot 2022-05-21 143338.png
According to your attachment a VBA demonstration as a beginner starter :
PHP Code:
Sub Demo1()
With Sheet1.UsedRange
.Cells(.Rows.Count, 6).Formula = "=COUNTA(" & .Columns(4).Address & ")-1"
End With
End Sub
► Do you like it ? ► ► So thanks to click on bottom left star icon « ★ Add Reputation » ! ◄ ◄
Hi Marc L
thank you for your code,
May I ask more, It's possible to add Total formula @ Column J with the same code?
Last edited by yukioh; 05-25-2022 at 08:35 AM.
Yes you can ! Just duplicate the codeline and update it, no difficulty …
For more help if really necessary what is the formula you manually use ?
Last edited by Marc L; 05-22-2022 at 05:17 AM.
I use =Sum(xx:xx)
Could you please help me on that...
According to your attachment another beginner level VBA demonstration :
PHP Code:
Sub Demo2()
With Sheet1.Cells(Rows.Count, 1).End(xlUp).CurrentRegion.Rows
.Cells(.Count, 6).Formula = "=COUNTA(D" & .Row + 1 & ":D" & .Row + .Count - 2 & ")"
.Cells(.Count, 12).Formula = "=SUM(J" & .Row + 1 & ":J" & .Row + .Count - 2 & ")"
End With
End Sub
► Do you like it ? ► ► So thanks to click on bottom left star icon « ★ Add Reputation » ! ◄ ◄
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks