jjfletcher
Board Regular
- Joined
- Sep 10, 2008
- Messages
- 152
Hello All,
I have this code that provides the total sum of numbers in a ListBox column, but I would like to convert this code to count just the number of Rows in each Column and show that number in the assigned Label
Hope that makes sense?
Regards,
John
I have this code that provides the total sum of numbers in a ListBox column, but I would like to convert this code to count just the number of Rows in each Column and show that number in the assigned Label
Hope that makes sense?
VBA Code:
Private Sub SumLabels()
Dim X, j, k
On Error Resume Next
X = 0
For k = 34 To 38
With Results
For j = 0 To .ListCount - 1
X = X + .List(j, k - 28)
Next
If k > 34 And k < 38 Then
Me("Label" & k).Caption = X '+ .ListCount '/ .ListCount
Else
Me("Label" & k).Caption = X
End If
X = 0
End With
Next
End Sub
Regards,
John