Sub MAJ_Imputation()
Dim ncol%
Application.ScreenUpdating = False
On Error Resume Next 's'il n'y a pas de SpecialCells
With Feuil01.[A7].CurrentRegion
With .Offset(1).Resize(.Rows.Count - 1)
ncol = .Columns.Count
.Cells(1, ncol + 1) = 1
.Columns(ncol + 1).DataSeries '1ère colonne auxiliaire, ordre initial numéroté
.Columns(ncol + 2) = 0
Intersect(.Columns(ncol).SpecialCells(xlCellTypeBlanks).EntireRow, .Columns(ncol + 2)) = 1 '2ème colonne auxiliaire
.Resize(, ncol + 2).Sort .Columns(ncol + 2), xlAscending, Header:=xlNo 'tri sur la 2ème colonne auxiliaire
.Columns(ncol).SpecialCells(xlCellTypeBlanks) = "=IF(ROW()=MATCH(RC1,C1,0),"""",INDEX(C,MATCH(RC1,C1,0)))" 'copie la 1ère occurence
.Columns(ncol) = .Columns(ncol).Value 'supprime les formules
.Columns(ncol + 3) = "=1/(RC[-1]=1)/(RC[-3]<>"""")" '3ème colonne auxiliaire
Intersect(.Columns(ncol), .Columns(ncol + 3).SpecialCells(xlCellTypeFormulas, 1).EntireRow).Interior.ColorIndex = 6 'jaune
.Resize(, ncol + 1).Sort .Columns(ncol + 1), xlAscending, Header:=xlNo 'remise en ordre initial
.Columns(ncol + 1).Resize(, 3) = "" 'RAZ des 3 colonnes auxiliaires
End With
End With
End Sub