Salut FORUM
JE voudrais ajouter des numeros d'ordre à mes enregistrements effectués.
J'ai donc élaboré le code qui suit et qui marche comme souhaité.
Par curiosité j'aimerais savoir si je peux avoir mieux.
Les numéros sont en colonne A
Merci
Sub num()
Range("A2").Value = Range("B" & Rows.Count).End(xlUp).Row - 1
Range("A3").Value = Range("B" & Rows.Count).End(xlUp).Row - 2
Range("A2:A3").AutoFill Destination:=Range("A2:A" & Range("B" & Rows.Count).End(xlUp).Row), Type:=xlFillDefault End Sub
Sub Macro3()
With Range("A2").Resize(Range("B" & Rows.Count).End(xlUp).Row - 1)
.Formula = "=" & .Rows.Count + 2 & "-ROW()": .Value = .Value
End With
End Sub
Sub Macro3()
With Range("A2").Resize(Range("B" & Rows.Count).End(xlUp).Row - 1)
.Formula = "=" & .Rows.Count + 2 & "-ROW()": .Value = .Value
End With
End Sub