|
For i = 1 to Range("B1").End(xlDown).Row
If checkbox1.Value = True Then
If LEFT(LCase(Cells( i, 2).Value),1) = "a" Then
Cells( i, 20) = "a"
Cnt1 = Cnt1 + 1
End If
Else
If checkbox2.Value = True Then
If LEFT(LCase(Cells( i, 2).Value),1) = "b" Then
Cells( i, 20) = "b"
Cnt2 = Cnt2 + 1
End If
Else
If checkbox3.Value = True Then
If LEFT(LCase(Cells( i, 2).Value),1) = "c" Then
Cells( i, 20) = "c"
Cnt3 = Cnt3 + 1
End If
End If
End If
End If
Next i
Cells( Range("B1").End(xlDown).Row + 1, 20) = "end"
TextBox1.Value = Cnt1
TextBox2.Value = Cnt2
TextBox3.Value = Cnt3
For i = 1 to Range("B1").End(xlDown).Row
If Cells( i, 20).Value = "end" Then
Exit Sub
End If
If Cells( i, 20).Value = "" Then
Rows(i).Select
Selection.Delete Shift:=xlUp
i = i - 1
End If
Next i
|
|