Option Explicit
Sub CréerLesFichiers()
Dim f As Worksheet, i&, nomf$, value_$, avoir_$, compl_$
Set f = Sheets("Comptes comité 2023")
For i = 1 To Range("A" & Rows.Count).End(xlUp).Row
nomf = Range("A" & i)
value_ = Range("B" & i)
avoir_ = Range("C" & i)
compl_ = Range("D" & i)
Sheets(Array("Comptes comité 2023", "Codification 2023", "Répartition des postes")).Copy
With ActiveWorkbook
.Sheets(1).Range("D1").Value = value_
.Sheets(1).Range("G5").Avoir = avoir_
.Sheets(1).Range("G6").Compl = compl_
.SaveAs ThisWorkbook.Path & "\" & nomf & ".xlsx"
.Close
End With
Next i
End Sub