Salut bbto,
finalement, j'avais crié au loup un peu vite... Déso...
Le résultat s'affiche en feuille 'Extract' : vaut mieux essayer avant d'écraser ta BDD originale !
Un double-clic sur la feuille 'Résultat3' démarre la macro.
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
'
Dim tTab
'
Cancel = True
On Error Resume Next
Application.ScreenUpdating = False
'
tTab = Range("A1:I" & Range("A" & Rows.Count).End(xlUp).Row).Value
'
For x = 2 To UBound(tTab, 1) - 1
If tTab(x, 1) = tTab(x + 1, 1) And (tTab(x, 3) = 0 Or tTab(x, 3) = "") Then
For y = 3 To 9
If tTab(x, y) = "" Then tTab(x, y) = tTab(x + 1, y)
Next
tTab(x + 1, 1) = ""
End If
Next
With Worksheets("Extract")
.Cells.Delete
.Range("A1").Resize(UBound(tTab, 1), 9).Value = tTab
.Range("A:A").SpecialCells(xlCellTypeBlanks).EntireRow.Delete
.Columns.AutoFit
.Activate
End With
'
Application.ScreenUpdating = True
On Error GoTo 0
'
End Sub
Après essais concluants, pour le traitement de ta BDD et écrasement de celle-ci, faire les transformations suivantes.
Je te conseille quand même de sauver le fichier traité sous un autre nom : sécurité!
Cells.Delete
Range("A1").Resize(UBound(tTab, 1), 9).Value = tTab
Range("A:A").SpecialCells(xlCellTypeBlanks).EntireRow.Delete
A+