Quantcast
Channel: Active questions tagged excel - Stack Overflow
Viewing all articles
Browse latest Browse all 88809

Have data query automatically refresh if other query is refresehed first

$
0
0

I have a workbook with two data queries. I want to have the 2nd query automatically refreshed if the first query is manually refreshed. Below is the VBA code I have so far:

Private Sub Worksheet_Change(ByVal Target As Range)

Application.ScreenUpdating = False

Sheets("Sheet2").ListObjects("Query2").QueryTable.Refresh

Application.ScreenUpdating = True

End Sub

The problem with the above code is that it tries to refresh the 2nd query before the first is finished which causes an error. Any help with this problem would be greatly appreciated.

Thank you!


Viewing all articles
Browse latest Browse all 88809

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>