Bonjour,
Je voudrais lister tous les "tableaux" ou "tables" de toutes mes feuilles mais je ne trouve pas la syntaxe à utiliser...
J'ai bien un truc ainsi mais il "oublie" les 2 ou tableaux d'un même onglet
Sub BoucleTableauxFeuille()
Dim Ws As Worksheet
Dim ListObj As ListObject
Set Ws = Worksheets("Feuil1")
For Each ListObj In Ws.ListObjects
MsgBox ListObj.Name & " : " & ListObj.Range.Address
Next
End Sub
edit: Oups ! trouvé sur forum anglophone
Sub LoopThroughAllTablesinWorkbook()
'PURPOSE: Loop through and apply a change to all Tables in the Excel Workbook
'SOURCE: www.TheSpreadsheetGuru.com/the-code-vault
Dim tbl As ListObject
Dim sht As Worksheet
Dim I: I = 4
'Loop through each sheet and table in the workbook
For Each sht In ThisWorkbook.Worksheets
For Each tbl In sht.ListObjects
Sheets("3-fournisseur").Cells(I, "I") = sht.Name
Sheets("3-fournisseur").Cells(I, "J") = tbl.Name
Sheets("3-fournisseur").Cells(I, "K") = tbl.Range.Address
I = I + 1
Next tbl
Next sht
End Sub
Sorry , google est mon ami , je confirme