Human_doing
Board Regular
- Joined
- Feb 16, 2011
- Messages
- 137
Hi all,
Can anyone please amend the below code. The objective is that cell E2 contains the result of a COUNTIF of all cells in column B with data i.e. the final output might be:
=COUNTIF(B1:B18,"*")
But there may be more or fewer than 18 rows?
Thanks
Can anyone please amend the below code. The objective is that cell E2 contains the result of a COUNTIF of all cells in column B with data i.e. the final output might be:
=COUNTIF(B1:B18,"*")
But there may be more or fewer than 18 rows?
Thanks
Code:
Dim LR As Long
With ActiveSheet
LR = .Range("B" & .Rows.Count).End(xlUp).Row
.Range("E2").Formula = "=COUNTIF((B2:B" & LR & " ," * "))"
End With