I'm trying to loop through listbox(attached picture below), and if the column(3) has value, then copy & paste row to empty row in excel sheet for later use. I wanted to copy the row using column value to put it in sheet, but it just copys last row value, and repeats. Could you please point out what I did wrong in the below code?
TIA
s = 22
For i = 0 To Me.AnBox.ListCount - 1
If Me.AnBox.Column(3) <> "" Then
Sheets("SparePartsRequestForm").Range("A" & s).Value = Me.AnBox.Column(2)
Sheets("SparePartsRequestForm").Range("C" & s).Value = Me.AnBox.Column(1)
Sheets("SparePartsRequestForm").Range("D" & s).Value = Me.AnBox.Column(3)
s = s + 1
End If
Next i