Public Sub ProcessData()
Dim i As Long
Dim LastRow As Long
Dim NextRow As Long
Dim this As Worksheet
Dim sh As Worksheet
Dim ii As Integer
ii = CLng(InputBox(Prompt:="Quelle colonne ?"))
With Application
.ScreenUpdating = False
.Calculation = xlCalculationManual
End With
Set this = ActiveSheet
With this
LastRow = .Cells(.Rows.Count, ii).End(xlUp).Row
For i = 2 To LastRow
Set sh = Nothing
On Error Resume Next
Set sh = Worksheets(.Cells(i, ii).Value)
If Err <> 0 Then Err.Clear
If sh Is Nothing Then
Worksheets.Add after:=Worksheets(Worksheets.Count)
Set sh = ActiveSheet
sh.Name = .Cells(i, ii).Value
.Rows(1).Copy sh.Cells(1) 'modif
End If
NextRow = sh.Cells(sh.Rows.Count, ii).End(xlUp).Row + 1
.Rows(i).Copy sh.Cells(NextRow, 1) 'modif
Next i
End With
With Application
.Calculation = xlCalculationAutomatic
.ScreenUpdating = True
End With
Ender:
End Sub