1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| Sub Separer()
Dim sh As Worksheet
Dim shNouveau As Worksheet
Dim i As Integer
Set sh = ActiveSheet
For i = 2 To Range("A65536").End(xlUp).Row 'Depart des données, j'imagine que la ligne 1 est l'en-tête.
Set shNouveau = Sheets.Add
shNouveau.Name = sh.Cells(i, 1)
shNouveau.Cells(1, 1) = sh.Cells(1, 1)
shNouveau.Cells(1, 2) = sh.Cells(1, 2)
shNouveau.Cells(1, 3) = sh.Cells(1, 3)
shNouveau.Cells(1, 4) = sh.Cells(1, 4)
shNouveau.Cells(2, 1) = sh.Cells(i, 1)
shNouveau.Cells(2, 2) = sh.Cells(i, 2)
shNouveau.Cells(2, 3) = sh.Cells(i, 3)
shNouveau.Cells(2, 4) = sh.Cells(i, 4)
Next i
End Sub |
Partager