Hi!
I have this code:
---
Sub Copy()
Dim Row As Long, Col As Long
Set Dest = Sheets(3).Range("B" & Rows.Count).End(xlUp).Offset(1)
Sheets(1).Activate
Dim v As Variant
Z = Array("E", "D", "F")
For Row = 17 To Range("A" & Rows.Count).End(xlUp)
For Col = 0 To UBound(Z)
If Sheets(1).Cells(Row, Z(Col)) <> "" Then
Sheets(1).Cells(Row, Z(Col)).Copy Dest
Next Col
End If
Next Row
End Sub
---
It doesn't work. It doesn't do the loop. What am I doing wrong?
---
What I want the macro to do is this:
1. Start on row 17 Sheet1 and evaluate columns D, E, F
2. If cell on column E has code, it should copy it to first empty cell in column B on sheet2. If not, it should see if column D has code and do the same. If not, then it should go to cell in column F.
3. Do the same on each row with data on sheet1
I've managed to do some steps, but the loops don't work
Any help?
I have this code:
---
Sub Copy()
Dim Row As Long, Col As Long
Set Dest = Sheets(3).Range("B" & Rows.Count).End(xlUp).Offset(1)
Sheets(1).Activate
Dim v As Variant
Z = Array("E", "D", "F")
For Row = 17 To Range("A" & Rows.Count).End(xlUp)
For Col = 0 To UBound(Z)
If Sheets(1).Cells(Row, Z(Col)) <> "" Then
Sheets(1).Cells(Row, Z(Col)).Copy Dest
Next Col
End If
Next Row
End Sub
---
It doesn't work. It doesn't do the loop. What am I doing wrong?
---
What I want the macro to do is this:
1. Start on row 17 Sheet1 and evaluate columns D, E, F
2. If cell on column E has code, it should copy it to first empty cell in column B on sheet2. If not, it should see if column D has code and do the same. If not, then it should go to cell in column F.
3. Do the same on each row with data on sheet1
I've managed to do some steps, but the loops don't work
Any help?