Mon fichier et macro si dessous
Sub SSO()
'
Dim sNomRech As String
Dim oShSource As Worksheet
Dim oShDest As Worksheet
Dim iLue As Long
Dim iEcr As Long
Dim bFin As Boolean
sNomRech = InputBox("Numéro SSO ?")
Sheets.Add(after:=Worksheets(Worksheets.Count)).Name = sNomRech
If sNomRech = "" Then
Exit Sub
End If
Application.ScreenUpdating = False
Set oShSource = Worksheets("IBtrackextract")
Set oShDest = Worksheets(sNomRech)
iLue = 2
iEcr = oShDest.Range("A" & Rows.Count).End(xlUp).Row + 1
bFin = False
While Not bFin
If oShSource.Range("A" & iLue).Value = "" Then
bFin = True
Else
If oShSource.Range("AV" & iLue).Value = sNomRech Then
oShSource.Rows(iLue).Copy
oShDest.Range("A" & iEcr).PasteSpecial xlPasteAll
Application.CutCopyMode = False
oShSource.Rows(iLue).Delete
iEcr = iEcr + 1
'reste sur la même ligne
Else
'ligne suivante
iLue = iLue + 1
End If
End If
Wend
Application.ScreenUpdating = True
MsgBox "Terminé !", vbExclamation
Set oShSource = Nothing
Set oShDest = Nothing
'
End Sub