B
Brian C
I am counting the rows in a selected column using the following code which is
working fine. However, I would like to modify this to count the rows where
the value <> 0.
Please help
Dim rng As Range, rng1 As Range
Set rng = Selection
If rng.Areas.Count > 1 Then
MsgBox "non contiguous areas selected - exiting"
Exit Sub
End If
If rng.Columns.Count > 1 Then
MsgBox "multiple columns selected = exiting"
Exit Sub
End If
Set rng1 = rng(rng.Count).Offset(1, 0)
rng1.Formula = "=Count(" & rng.Address(1, 1) & ")"
working fine. However, I would like to modify this to count the rows where
the value <> 0.
Please help
Dim rng As Range, rng1 As Range
Set rng = Selection
If rng.Areas.Count > 1 Then
MsgBox "non contiguous areas selected - exiting"
Exit Sub
End If
If rng.Columns.Count > 1 Then
MsgBox "multiple columns selected = exiting"
Exit Sub
End If
Set rng1 = rng(rng.Count).Offset(1, 0)
rng1.Formula = "=Count(" & rng.Address(1, 1) & ")"