Option Explicit
Sub Générer()
Dim CelADéb As Range, NbLig As Long
Set CelADéb = Feuil2.[A1000000].End(xlUp).Offset(1)
NbLig = Feuil2.[B1000000].End(xlUp).Row + 1 - CelADéb.Row
If NbLig > 0 Then
With CelADéb.Resize(NbLig)
.Formula = "=""" & Feuil1.[A1].Value & Format(Date, "ddmmyyyy") _
& Feuil1.[A2].Value & """&TEXT(ROW()-" & CelADéb.Row - 1 & ",""00"")"
.Value = .Value: End With
If NbLig > 1 Then MsgBox NbLig & " lignes ont été numérotées.", vbInformation, "Générer" _
Else MsgBox "Une ligne à été numérotée.", vbInformation, "Générer"
Else
MsgBox "Aucune ligne n'a été numérotée.", vbExclamation, "Générer"
End If
End Sub