PDA

View Full Version : Macro to Replace Query



jo15765
11-17-2011, 09:44 AM
I have a Excel workbook with about 10 different worksheets. On each worksheet there is about 8 different queries. The way I have been making the change when it comes time is I would right click on the query, select edit query, then go into the SQL and point the query at the new database I need it to pull data from.

Long story short, is there a way to automate this process instead of me manually having to do it each time?

mdmackillop
11-17-2011, 02:32 PM
Can you post the SQL statement?