I'm doing a For
in another For
, where it runs per column, finds the cell and copies, in the other For
it runs column as well and it queues in a range. However, the code is executing a whole For
first and then executing the other and executing the two (copying and pasting).
Can you help me? Below is the code I've made ...
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