Sub Remplir_Tablo()
Dim ws As Worksheet, dl As Integer, i As Integer
'Dim Tb(1 To 4, 1 To 1)
Dim Tb()
'Tb(1, 1) = "Mois": Tb(1, 2) = "No Chantier": Tb(1, 3) = "Entreprise": Tb(1, 4) = "PV"
With Worksheets("Diagrame année")
For Each ws In ThisWorkbook.Worksheets ' on parcourt toutes les feuilles du classeur
If ws.Name <> "Diagrame année" Then
dl = ws.Cells(Rows.Count, 1).End(xlUp).Row
For i = 2 To dl
If ws.Range("H" & i) = "Facture envoyé" Then 'condition à vérifier
n = n + 1
ReDim Preserve Tb(1 To 4, 1 To n)
Tb(1, n) = ws.Name
Tb(2, n) = ws.Range("A" & i)
Tb(3, n) = ws.Range("B" & i)
Tb(4, n) = ws.Range("G" & i)
End If
Next i
''---------------------------------------------------------------------------------------------
End If
Next ws
.[a1].CurrentRegion.Clear
.[a1].Resize(UBound(Tb, 2), UBound(Tb)) = Application.Transpose(Tb)
End With
MsgBox "Process terminé!"
End Sub