I'm trying to refresh a query on a cell change, however I can't figure out how to reference the query.
My code: Sheets("Roster Query").QueryTables(0).Refresh
Just errors out with:
Run-time error '1004':
Application-defined or object-defined error
I have a sheet named "Roster Filter" that has query table I want to refresh. How can I get that QueryTable and refresh it?
Edit: Also tried:
For Each qt In Sheets("Roster Query").QueryTables
qt.Refresh
Next
This does not error out, but the query is not refreshed.