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 30 31 32
| Sub CopieColleFacturesMS()
Dim i As Long, k As Long, igneDeDepart As Long, ligneDArrivee As Long
Dim colonne As Integer, nbreDeCopies As Integer
Application.ScreenUpdating = False
'Définition de la colonne de destination de copie
colonne = 3
ligneDeDepart = 3
nbreDeCopies = 10
ligneDArrivee = ligneDeDepart + (29 * nbreDeCopies)
'Initialisation de la première ligne à copier
k = 6
'Boucle de copie des tableaux: le premier tableau commence à la ligne 3, et chaque tableau est espacé par 29 lignes.
With Worksheets("7.Etiquettes")
For i = ligneDeDepart To ligneDArrivee Step 29
.Range(.Cells(i, colonne), .Cells(i + 12, colonne)).Value = Worksheets("1. Patrimoine").Cells(k, 5)
.Range(.Cells(i, colonne + 1), .Cells(i + 12, colonne + 1)).Value = Worksheets("1. Patrimoine").Cells(k, 4)
.Range(.Cells(i, colonne + 2), .Cells(i + 12, colonne + 2)).Value = Worksheets("1. Patrimoine").Cells(k, 1)
.Range(.Cells(i, colonne + 3), .Cells(i + 12, colonne + 3)).Value = Worksheets("1. Patrimoine").Cells(k, 3)
.Range(.Cells(i, colonne + 4), .Cells(i + 12, colonne + 4)).Value = Worksheets("1. Patrimoine").Cells(k, 8)
.Range(.Cells(i, colonne + 5), .Cells(i + 12, colonne + 5)).Value = Worksheets("1. Patrimoine").Cells(k, 9)
.Range(.Cells(i, colonne + 6), .Cells(i + 12, colonne + 6)).Value = Worksheets("1. Patrimoine").Cells(k, 10)
.Range(.Cells(i, colonne + 7), .Cells(i + 12, colonne + 7)).Value = Worksheets("1. Patrimoine").Cells(k, 7)
.Range(.Cells(i, colonne + 8), .Cells(i + 12, colonne + 8)).Value = Worksheets("1. Patrimoine").Cells(k, 14)
.Range(.Cells(i, colonne + 9), .Cells(i + 12, colonne + 9)).Value = Worksheets("1. Patrimoine").Cells(k, 13)
.Range(.Cells(i, colonne + 10), .Cells(i + 12, colonne + 10)).Value = Worksheets("1. Patrimoine").Cells(k, 34)
.Range(.Cells(i, colonne + 11), .Cells(i + 12, colonne + 11)).Value = Worksheets("1. Patrimoine").Cells(k, 35)
.Range(.Cells(i, colonne + 12), .Cells(i + 12, colonne + 12)).Value = Worksheets("1. Patrimoine").Cells(k, 41)
k = k + 1
Next i
End With
End Sub |
Partager