1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
| Sub inser_copier()
Dim i As Integer, j As Integer
Dim x As Integer, y As Integer
Dim nbs As Integer, nbi As Integer
x = 1
y = 0
nbs = InputBox("combien de ligne vous voulez sauter?")
nbi = InputBox("combien de ligne vous voulez insérer?")
For i = 1 To 50 Step nbs
For j = 1 To nbi
Cells(i + (nbs + y) - 1, 1).Select
Selection.EntireRow.Insert Shift:=xlDown
y = y + 1
Next
For j = 1 To nbi
Sheets("Feuil2").Select
Sheets("Feuil2").Rows(x & ":" & (x + nbi) - 1).Select
Selection.Copy
Sheets("Feuil1").Select
ActiveSheet.Paste
Next
x = x + nbi
Next
End Sub |
Partager