Sub RemplissageDonneesDuMois()
Dim i&, t As ListObject, PremièreLigne&, DernièreLigne&
Set t = ActiveSheet.ListObjects("Tableau1")
With t.DataBodyRange
With .Cells(1, 3)
If IsEmpty(.Value) Then PremièreLigne = .Row Else PremièreLigne = .Offset(-1).End(xlDown).Offset(1).Row
End With
With .Cells(t.ListRows.Count, 1)
If IsEmpty(.Value) Then DernièreLigne = .End(xlUp).Row Else DernièreLigne = .Row
End With
If PremièreLigne <= DernièreLigne Then
For i = 2 To 6
Range(Cells(PremièreLigne, .Column + i), Cells(DernièreLigne, .Column + i)).FormulaR1C1 = _
"=INDEX(Tblo2[#Data],MATCH(RC2,Tblo2[mars-13],0)," & i & ")"
Next
'Ligne facultative pour effacer les formules et ne garder que les valeurs :
' With Range(Cells(PremièreLigne, .Column + 2), Cells(DernièreLigne, t.ListColumns.Count + .Column - 1)): .Value = .Value: End With
End If
End With
End Sub