Bonjour Dhany, Steelson, le forum,
merci pour vos réponses rapides.
Je m'y retrouve pas avec votre code initial.
Sub test2()
Set wk1 = Workbooks("A")
Set wk2 = Workbooks("B")
Set sh1 = wk1.Sheets("inventaire")
Set sh2 = wk2.Sheets("stock")
rwB = sh2.Cells(Rows.Count, 1).End(xlUp).Row
For i = 2 To rwB
sh1.Cells(4 * i - 1, "A") = sh2.Cells(i, "A").Value
Next
End Sub
Mais celui là marche d'enfer :
Sub test()
Dim wbk As Workbook, sh As Worksheet, dlg&, lg1&, lg2&
Set wbk = Workbooks("STOCK"): Set sh = wbk.Worksheets("stock")
'dernière ligne utilisée sur la feuille "stock", selon col A
dlg = sh.Cells(Rows.Count, 1).End(xlUp).Row
For lg1 = 2 To dlg
'formule de progression
lg2 = 4 * (lg1 - 2) + 3
With sh.Cells(lg1, 1)
Cells(lg2, 1) = .Value
Cells(lg2, 2) = .Offset(, 1)
Cells(lg2, 3) = .Offset(, 2)
End With
Next lg1
End Sub
bravo Dhany pour la formule de progression.
a+
fronck