0
I’m performing a For
inside another For
, where you run by column, find the cell and copy in the other For
run column as well and paste into a range. However, the code is performing an entire For
first to then perform the other and I need you to execute both (copying and pasting).
Can you help me? Below the code I performed...
SUB ()
Set Cop = Workbooks(Arq)
L = Cop.Sheets("Consolidado_Vendas_TFN").Range("J1048576").End(xlUp).Row
For w = 15 To 135
If Cells(6, w) <> "" Then
Cells(6, w).Copy
End If
For y = 18 To 138
If Cells(8, y) = "" Then
Sheets("Consolidado_Vendas_TFN").Range(Cells(8, y), Cells(L, y)).PasteSpecial xlValues
w = w + 4
y = y + 4
End If
If w = 136 And y = 139 Then
Exit For
Exit For
Else
w = w - 1
y = y - 1
End If
Next y
Next w
END SUB
What do you really want? Could you put pictures? Because your code shows that you copy a cell from a non-empty column and try to paste into a range from row 8 to the last row of column J
– danieltakeshi