Sub test()
Dim Col As Collection
Dim LR As Long, i As Long
Dim j5 As Integer, j6 As Integer, j As Integer
Set Col = New Collection
j5 = 5
j6 = 6
With Worksheets("Sheet1")
LR = .Cells(Rows.Count, 1).End(xlUp).Row
For i = 2 To LR
If .Cells(i, j5).Value = 0 Then
On Error Resume Next
Col.Add .Cells(i, 1).Value, CStr(.Cells(i, 1).Value)
End If
If .Cells(i, j6).Value <> 0 Then
On Error Resume Next
Col.Add .Cells(i, 1).Value, CStr(.Cells(i, 1).Value)
End If
Next i
End With
With Worksheets("Sheet2")
For j = 1 To Col.Count
.Cells(j + 3, 1) = Col(j)
Next j
End With
End Sub
Bookmarks