refresh both the External data source and pivot tables together within a time schedule

前端 未结 5 2055
感动是毒
感动是毒 2020-12-05 09:09

In my last post Auto refresh pivottables data in excel on first run, i found that on my first execution the query from the Externa

5条回答
  •  天涯浪人
    2020-12-05 09:35

    Auto Refresh Workbook for example every 5 sec. Apply to module

    Public Sub Refresh()
    'refresh
    ActiveWorkbook.RefreshAll
    
    alertTime = Now + TimeValue("00:00:05") 'hh:mm:ss
        Application.OnTime alertTime, "Refresh"
    
    End Sub
    

    Apply to Workbook on Open

    Private Sub Workbook_Open()
    alertTime = Now + TimeValue("00:00:05") 'hh:mm:ss
    Application.OnTime alertTime, "Refresh"
    End Sub
    

    :)

提交回复
热议问题