irisqueiroz
Member
Hi,
I'd like to know how can I set up two different kind of loops to running at the same time. I want this:
"For each cell in RANGE and For i=1 to 10" (for example)
Loop would be: cell(1) and i=1 ; cell(2) and i=2 ...
I wrote:
[pre]
[/pre]
But in this case its cell(1) then all the loop between i=2 and i=lastline ... cell(2) then all the loop between i=2 and i=lastline ... etc
Thanks
I'd like to know how can I set up two different kind of loops to running at the same time. I want this:
"For each cell in RANGE and For i=1 to 10" (for example)
Loop would be: cell(1) and i=1 ; cell(2) and i=2 ...
I wrote:
[pre]
Code:
For Each cell In FornecedoresG
valor = Application.WorksheetFunction.Match(cell, FornecedoresH, 0)
If Not (IsEmpty(valor)) Then
sname = FornecedoresH.Cells(1, 1).Offset(valor - 1, 1).value
End If
For i = 2 To ULinhaG
Range(Cells(i, 1), Cells(i, 6)).Select
Selection.Copy
Windows("org_mangaratiba.xlsx").Activate
Sheets(sname).Paste
Windows("despesa_anual.xlsm").Activate
Next
Next
But in this case its cell(1) then all the loop between i=2 and i=lastline ... cell(2) then all the loop between i=2 and i=lastline ... etc
Thanks