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 33
| Sub mise_en_forme()
Dim n As Long, i As Long
n = 1
i = 1
Application.ScreenUpdating = False
Sheets.Add.Name = "BDD"
For i = 2 To (WorksheetFunction.CountA(Worksheets("Feuil1").Range("A:A")))
Worksheets("Feuil1").Select
Range(Cells(i, 1), Cells(i, 9)).Copy
Worksheets("BDD").Select
Range(Cells(n, 1), Cells(n + 11, 1)).PasteSpecial Paste:=xlPasteColumnWidths, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
ActiveSheet.Paste
Worksheets("Feuil1").Select
Range(Cells(1, 10), Cells(1, 22)).Copy
Worksheets("BDD").Select
Cells(n, 10).PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:=False, Transpose:=True
Worksheets("Feuil1").Select
Range(Cells(i, 10), Cells(i, 22)).Copy
Worksheets("BDD").Select
Cells(n, 11).PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:=False, Transpose:=True
n = n + 12
Next
Application.ScreenUpdating = True
End Sub |
Partager