开发者

enumerate queries in sheets of an excel workbook

I need a vba macro to enumerate the开发者_StackOverflow 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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜