liamtnelson
New Member
- Joined
- Oct 8, 2014
- Messages
- 2
I have this code in excel, its basically scanning and sorting data from another spreadsheet. Here's where the error pops up..
Do Until wsa.Cells(i, "B") = ""
If wsa.Cells(i, "H") <> 54 Then
i = i + 1
ElseIf wsa.Cells(i, "H") = 54 Then
j = 2
Do
If wsc.Cells(j, "D") = "" Then
wsc.Cells(j, "D") = wsa.Cells(i, "H")
wsc.Cells(j, "E") = wsa.Cells(i, "J")
i = i + 1
ElseIf wsc.Cells(j, "D") = 54 Then
j = 2
Do
If wsa.Cells(i, "J") = wsc.Cells(j, "E") Then
wsc.Cells(j, "F").Value = wsc.Cells(j, "F").Value + 1
i = i + 1
Exit Do
ElseIf wsc.Cells(j, "E") = "" Then
wsc.Cells(j, "D") = wsa.Cells(i, "H")
wsc.Cells(j, "E") = wsa.Cells(i, "J")
i = i + 1
Exit Do
ElseIf wsa.Cells(i, "J") <> wsc.Cells(j, "E") Then
j = j + 1
End If
Loop
End If
Exit Do
End If
Loop
End Sub
Do Until wsa.Cells(i, "B") = ""
If wsa.Cells(i, "H") <> 54 Then
i = i + 1
ElseIf wsa.Cells(i, "H") = 54 Then
j = 2
Do
If wsc.Cells(j, "D") = "" Then
wsc.Cells(j, "D") = wsa.Cells(i, "H")
wsc.Cells(j, "E") = wsa.Cells(i, "J")
i = i + 1
ElseIf wsc.Cells(j, "D") = 54 Then
j = 2
Do
If wsa.Cells(i, "J") = wsc.Cells(j, "E") Then
wsc.Cells(j, "F").Value = wsc.Cells(j, "F").Value + 1
i = i + 1
Exit Do
ElseIf wsc.Cells(j, "E") = "" Then
wsc.Cells(j, "D") = wsa.Cells(i, "H")
wsc.Cells(j, "E") = wsa.Cells(i, "J")
i = i + 1
Exit Do
ElseIf wsa.Cells(i, "J") <> wsc.Cells(j, "E") Then
j = j + 1
End If
Loop
End If
Exit Do
End If
Loop
End Sub
Last edited: