我需要一个vba宏来枚举工作簿的每个工作表上的查询。
您能提供示例代码吗?
杰瑞E答案 0 :(得分:1)
你走了:
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