Trying to loop through a sheets"data".Range"AM1:AS12" and copy the data to range beginning at BD1 as long as the data doesn't equal "#N/A"
My code works with copying the first column, but doesn't do anything with the data after that. Where am I going wrong?
Set S2 = Sheets("data").Range("AM:AM")
Set S3 = Sheets("data").Range("BD:BD")
Dim i As Integer, j As Integer
j = 1
For i = 1 To 12
If S2.Cells(i, 1).Value <> "#N/A" Then
S3.Cells(j, 2).Value = S2.Cells(i, 1).Value
j = j + 1
End If
Next i
Set S2 = Sheets("data").Range("AM:AM") Set S3 = Sheets("data").Range("BD:BD") Dim i As Integer, j As Integer j = 1 For i = 1 To 12 If S2.Cells(i, 1).Value <> "" Then S3.Cells(j, 2).Value = S2.Cells(i, 1).Value j = j + 1 End If Next i