Is it possible to count the cells in a union that are greater than zero
the cells aren't connected
I use this code to select numeric values based on the names selected in a list box
so the code loops and builds the range based on each name selected
I end up with several cells that aren't connected
I would like to acquire a count of the numeric values greater than zero
I tried
but no luck
Thanks
Tom
the cells aren't connected
VBA Code:
For index = 0 To cs_selstn.stanbox.ListCount - 1
If cs_selstn.stanbox.Selected(index) Then
Set seqcar = canlis.Find(cs_selstn.stanbox.List(index), , , 1).Offset(, 1)
GoTo nexsta
End If
Next
nexsta:
For index = index To cs_selstn.stanbox.ListCount - 1
If cs_selstn.stanbox.Selected(index) Then
Set nexcar = canlis.Find(cs_selstn.stanbox.List(index), , , 1).Offset(, 1)
Set seqcar = Application.Union(seqcar, nexcar)
End If
Next
so the code loops and builds the range based on each name selected
I end up with several cells that aren't connected
I would like to acquire a count of the numeric values greater than zero
I tried
Code:
m = WorksheetFunction.CountIf(seqcar, ">0")
Thanks
Tom