Search code examples
excelvbabloomberg

Refresh Only One Worksheet of Bloomberg Data With VBA


I need to refresh only one worksheet of Bloomberg data with VBA. If I try with:

Application.Run "RefreshAllWorkbooks"
Application.Run "RefreshAllStaticData"

it will refresh all the Workbook.

Do you know how to refresh only one worksheet?

Thanks.


Solution

  • If you have a few query tables in a give worksheet, the easiest way to refresh each of them is to create a for-loop. This would refresh all the objects in the first worksheet of Excel:

    Sub TestMe()
    
        Dim jLo As ListObject
        For Each jLo In Worksheets(1).ListObjects
            jLo.QueryTable.Refresh
        Next jLo
    
    End Sub