Pinterest Pixel

Copy and Paste Queries Across Workbooks Using Power Query

Bryan
Power Query or Get & Transform (In Excel 2016) lets you perform a series of steps to transform your Excel data.
 One of the steps it allows you to copy an existing query from one workbook to another workbook! If you want to reuse a query, this is perfect as you will not need to redo the steps anymore.

Power Query or Get & Transform (In Excel 2016) lets you perform a series of steps to transform your Excel data.  One of the steps it allows you to copy an existing query from one workbook to another workbook! If you want to reuse a query, this is perfect as you will not need to redo the steps anymore.

Key Takeaways

  • Easily Transfer Queries – Power Query allows you to copy queries from one workbook to another, avoiding the need to recreate them from scratch.

  • Use the Query Editor for Copying – You can copy queries directly from Power Query Editor, ensuring all transformations and steps remain intact.

  • Maintain Connections to External Data – When pasting queries, Excel will prompt you to reconnect data sources, making it easy to adapt queries to new workbooks.

  • Export and Import Queries – You can export a query as a .OQY file or use the “Load To” option to transfer queries efficiently.

  • Reusability Saves Time – Copying queries helps maintain consistent data processing rules, improving efficiency and reducing errors.

The Data Setup

We will use the existing workbook from this tutorial of splitting dates. It splits the Order Date into Year, Month and Day.

Split the Date Using Power Query or Get & Transform

We want to reapply this same exact query to our other workbook with this data:

Copy and Paste Queries Across Workbooks Using Power Query

Download excel workbook 1Copy-and-Paste-Queries-Across-Workbooks-With-Query.xlsx

Download excel workbook 2Copy-and-Paste-Queries-Across-Workbooks-No-Query.xlsx

How to Copy and Paste Queries Across Workbooks Using Power Query

STEP 1: Open the workbook with the existing query.

Go to Data > Get & Transform > Show Queries

Copy and Paste Queries Across Workbooks Using Power Query

 

STEP 2: In Workbook Queries, right click on the Table1 Query and select Copy.

Copy and Paste Queries Across Workbooks Using Power Query

 

STEP 3: Jump over to the workbook that does not have this query yet.

Go to Data > Get & Transform > Show Queries

Copy and Paste Queries Across Workbooks Using Power Query

 

STEP 4: In Workbook Queries, right click on the pane and select Paste.

Copy and Paste Queries Across Workbooks Using Power Query

You can now see the same query applied now without even creating the steps manually!

The order date for this table as well has been split to Year, Month and Day!

Copy and Paste Queries Across Workbooks Using Power Query

 

Frequently Asked Questions

How do I copy a Power Query from one workbook to another?
Open Power Query Editor, right-click the query in the Queries pane, select Copy, then open the target workbook, open Power Query Editor, and click Paste.

Will the copied query keep its data source?
The structure of the query remains the same, but you may need to reconnect or adjust the data source settings in the new workbook.

Can I copy multiple queries at once?
Yes! In Power Query Editor, hold Ctrl (or Cmd on Mac), select multiple queries, then copy and paste them into another workbook.

What if my new workbook doesn’t recognize the data source?
You’ll need to go to Data Source Settings in Power Query and update the connections to match the new workbook’s file paths or database sources.

Is there another way to transfer queries besides copying?
Yes! You can export queries as a .OQY file or use the “Load To” option to create reusable connections across multiple workbooks.

If you like this Excel tip, please share it



Copy and Paste Queries Across Workbooks Using Power Query | MyExcelOnline


Bryan

Bryan Hong is an IT Software Developer for more than 10 years and has the following certifications: Microsoft Certified Professional Developer (MCPD): Web Developer, Microsoft Certified Technology Specialist (MCTS): Windows Applications, Microsoft Certified Systems Engineer (MCSE) and Microsoft Certified Systems Administrator (MCSA).

He is also an Amazon #1 bestselling author of 4 Microsoft Excel books and a teacher of Microsoft Excel & Office at the MyExecelOnline Academy Online Course.

See also  Split a Query into Two Parts in Power Query

Star 30 Days - Full Access Star

One Dollar Trial

$1 Trial for 30 days!

Access for $1

Cancel Anytime

One Dollar Trial
  • Get FULL ACCESS to all our Excel & Office courses, bonuses, and support for just USD $1 today! Enjoy 30 days of learning and expert help.
  • You can CANCEL ANYTIME — no strings attached! Even if it’s on day 29, you won’t be charged again.
  • You'll get to keep all our downloadable Excel E-Books, Workbooks, Templates, and Cheat Sheets - yours to enjoy FOREVER!
  • Practice Workbooks
  • Certificates of Completion
  • 5 Amazing Bonuses
Satisfaction Guaranteed
Accepted paymend methods
Secure checkout

Get Video Training

Advance your Microsoft Excel & Office Skills with the MyExcelOnline Academy!

Dramatically Reduce Repetition, Stress, and Overtime!
Exponentially Increase Your Chances of a Promotion, Pay Raise or New Job!

Learn in as little as 5 minutes a day or on your schedule.

Learn More!

Share to...