Hi everyone,
I am using vba to count the number of cells in a worksheet that contain "0" and the number of cells that contain a value then display the results in a msgbox, this code is working fine... what i would like it to do if possible is to also show in the same message box the members names that = "0".
Members names are in column "B", and the "0" value is in column "I", below is my code so far that works..
hope this is easy to understand..
Thanks in advance
I am using vba to count the number of cells in a worksheet that contain "0" and the number of cells that contain a value then display the results in a msgbox, this code is working fine... what i would like it to do if possible is to also show in the same message box the members names that = "0".
Members names are in column "B", and the "0" value is in column "I", below is my code so far that works..
hope this is easy to understand..
Code:
Sub Count_Fees()
Dim count As Integer
Dim count1 As Integer
Worksheets("Fees Paid").Select
Dim LR As Long, i As Long
count = 0
LR = Range("I" & Rows.count).End(xlUp).Row
For i = LR To 2 Step -1
If Range("I" & i).Value = "0" Then
count = count + 1
End If
Next i
Dim L As Long, j As Long
count1 = 0
LT = Range("I" & Rows.count).End(xlUp).Row
For j = LT To 2 Step -1
If Not Range("I" & j).Value = "0" Then
count1 = count1 + 1
End If
Next j
Worksheets("Fees Paid").Select
MsgBox count1 & " Fees Paid Counted and " _
& count & " Fees Unpaid Counted"
End Sub
Thanks in advance