I need a vba macro to enumerate the queries on each worksheet of a workbook.
Can you provide example code?
Jerry E
I need a vba macro to enumerate the queries on each worksheet of a workbook.
Can you provide example code?
Jerry E
Here you go:
Dim aSheet As Worksheet
For Each aSheet In Worksheets
Dim aQueryTable As QueryTable
For Each aQueryTable In aSheet.QueryTables
' Do something with aQueryTable, e.g.
MsgBox aQueryTable.Name
Next aQueryTable
Next aSheet