Private Sub CommandButton1_Click() [g3:h10].Clear x = 1 While Cells(x, 2).Value ”” x = x + 1 Wend Cells(4, 4) = x q = x For a = 1 To q If Cells(a, 1) = Cells(2, 4) Then m = m + 1 Cells(2 + m, 7) = Cells(a, 2) Cells(2 + m, 8) = Cells(a, 1) End If Next End Sub
Private Sub CommandButton1_Click()
[g3:h10].Clear
x = 1
While Cells(x, 2).Value ””
x = x + 1
Wend
Cells(4, 4) = x
q = x
For a = 1 To q
If Cells(a, 1) = Cells(2, 4) Then
m = m + 1
Cells(2 + m, 7) = Cells(a, 2)
Cells(2 + m, 8) = Cells(a, 1)
End If
Next
End Sub