{"id":12424,"date":"2019-06-12T13:17:45","date_gmt":"2019-06-12T11:17:45","guid":{"rendered":"https:\/\/www.myexcelonline.com\/?p=12424"},"modified":"2023-11-30T20:02:17","modified_gmt":"2023-11-30T19:02:17","slug":"copy-and-paste-queries-across-workbooks-using-power-query","status":"publish","type":"post","link":"https:\/\/www.myexcelonline.com\/meo-staging\/blog\/copy-and-paste-queries-across-workbooks-using-power-query\/","title":{"rendered":"Copy and Paste Queries Across Workbooks Using Power Query"},"content":{"rendered":"<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/blog\/installing-power-query-excel-2010\/\" target=\"_blank\" rel=\"noopener noreferrer\">Power Query<\/a> or Get &amp; Transform (In Excel 2016) lets you perform a series of steps to transform your Excel data. \u00a0One of the steps it allows you to <strong>copy an existing query from one workbook to another workbook<\/strong>!<\/p>\n<p>If you want to reuse a query, this is perfect as you will not need to redo the steps anymore.<\/p>\n<p>We will use the existing workbook from <a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/blog\/split-the-date-using-power-query-or-get-transform\/\" target=\"_blank\">this tutorial of splitting dates<\/a>. It splits the Order Date into Year, Month and Day.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" title=\"Split the Date Using Power Query or Get &amp; Transform\"  class=\"aligncenter size-full wp-image-11049\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2019\/01\/Split-the-Date-06.png\" alt=\"Split the Date Using Power Query or Get &amp; Transform\" width=\"588\" height=\"374\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2019\/01\/Split-the-Date-06.png 588w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2019\/01\/Split-the-Date-06-300x191.png 300w\" sizes=\"(max-width: 588px) 100vw, 588px\" \/><\/p>\n<p>We want to reapply this same exact query to our other workbook with this data:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" title=\"Copy and Paste Queries Across Workbooks Using Power Query\"  class=\"aligncenter size-full wp-image-12430\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2019\/05\/Copy-and-Paste-Queries-Across-Workbooks-01.png\" alt=\"Copy and Paste Queries Across Workbooks Using Power Query\" width=\"1107\" height=\"578\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2019\/05\/Copy-and-Paste-Queries-Across-Workbooks-01.png 1107w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2019\/05\/Copy-and-Paste-Queries-Across-Workbooks-01-300x157.png 300w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2019\/05\/Copy-and-Paste-Queries-Across-Workbooks-01-1024x535.png 1024w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2019\/05\/Copy-and-Paste-Queries-Across-Workbooks-01-768x401.png 768w\" sizes=\"(max-width: 1107px) 100vw, 1107px\" \/><\/p>\n<div class=\"after-post-box\">\n<p><iframe src=\"https:\/\/www.youtube.com\/embed\/7DosSaQRAX8?rel=0 \" width=\"800\" height=\"400\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><span data-mce-type=\"bookmark\" style=\"display: inline-block; width: 0px; overflow: hidden; line-height: 0;\" class=\"mce_SELRES_start\">\ufeff<\/span><\/iframe><a href=\"https:\/\/www.youtube.com\/c\/MyExcelOnlinecomtutorials?sub_confirmation=1\" target=\"_blank\" rel=\"noopener noreferrer nofollow\"><img loading=\"lazy\" decoding=\"async\" class=\"alignmiddle wp-image-111468 size-full\" style=\"vertical-align: middle;\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2019\/04\/1.yt_.png\" alt=\"\" title=\"\"><\/a><\/p>\n<p class=\"line-two\"><a class=\"IRPP_minimalist icon-download button small\" href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2019\/05\/Copy-and-Paste-Queries-Across-Workbooks-With-Query.xlsx\" target=\"_blank\" rel=\"noopener noreferrer\" data-leadbox=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2019\/05\/Copy-and-Paste-Queries-Across-Workbooks-With-Query.xlsx\" data-leadbox-id=\"147284833f72a2:12f08263ab46dc\"><span class=\"ctaText px-3 text-capitalize\">Download excel workbook 1<i class=\"fa fa-download\"><\/i><\/span><span class=\"postTitle px-3\">Copy-and-Paste-Queries-Across-Workbooks-With-Query.xlsx<\/span><\/a><\/p>\n<\/div>\n<div class=\"after-post-box\">\n<p class=\"line-two\"><a class=\"IRPP_minimalist icon-download button small\" href=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2019\/05\/Copy-and-Paste-Queries-Across-Workbooks-No-Query.xlsx\" target=\"_blank\" rel=\"noopener noreferrer\" data-leadbox=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2019\/05\/Copy-and-Paste-Queries-Across-Workbooks-No-Query.xlsx\" data-leadbox-id=\"147284833f72a2:12f08263ab46dc\"><span class=\"ctaText px-3 text-capitalize\">Download excel workbook 2<i class=\"fa fa-download\"><\/i><\/span><span class=\"postTitle px-3\">Copy-and-Paste-Queries-Across-Workbooks-No-Query.xlsx<\/span><\/a><\/p>\n<p class=\"line-two\">\n<\/div>\n<p><span style=\"color: #ff0000;\"><strong>STEP 1<\/strong>:<\/span> Open the workbook with the existing query.<\/p>\n<p>Go to <strong><em>Data &gt; Get &amp; Transform &gt; Show Queries<\/em><\/strong><\/p>\n<p><strong><em><img loading=\"lazy\" decoding=\"async\" title=\"Copy and Paste Queries Across Workbooks Using Power Query\"  class=\"aligncenter size-full wp-image-12431\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2019\/05\/Copy-and-Paste-Queries-Across-Workbooks-02.png\" alt=\"Copy and Paste Queries Across Workbooks Using Power Query\" width=\"1295\" height=\"257\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2019\/05\/Copy-and-Paste-Queries-Across-Workbooks-02.png 1295w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2019\/05\/Copy-and-Paste-Queries-Across-Workbooks-02-300x60.png 300w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2019\/05\/Copy-and-Paste-Queries-Across-Workbooks-02-1024x203.png 1024w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2019\/05\/Copy-and-Paste-Queries-Across-Workbooks-02-768x152.png 768w\" sizes=\"(max-width: 1295px) 100vw, 1295px\" \/><\/em><\/strong><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #ff0000;\"><strong>STEP 2: <\/strong><\/span>In Workbook Queries, right click on the <strong>Table1 Query<\/strong> and <strong>select Copy<\/strong>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" title=\"Copy and Paste Queries Across Workbooks Using Power Query\"  class=\"aligncenter size-full wp-image-12432\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2019\/05\/Copy-and-Paste-Queries-Across-Workbooks-03.png\" alt=\"Copy and Paste Queries Across Workbooks Using Power Query\" width=\"525\" height=\"750\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2019\/05\/Copy-and-Paste-Queries-Across-Workbooks-03.png 525w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2019\/05\/Copy-and-Paste-Queries-Across-Workbooks-03-210x300.png 210w\" sizes=\"(max-width: 525px) 100vw, 525px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><strong><span style=\"color: #ff0000;\">STEP 3:<\/span> <\/strong>Jump over to the workbook that does not have this query yet.<\/p>\n<p>Go to <strong><em>Data &gt; Get &amp; Transform &gt; Show Queries<\/em><\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" title=\"Copy and Paste Queries Across Workbooks Using Power Query\"  class=\"aligncenter size-full wp-image-12433\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2019\/05\/Copy-and-Paste-Queries-Across-Workbooks-04.png\" alt=\"Copy and Paste Queries Across Workbooks Using Power Query\" width=\"1282\" height=\"1052\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2019\/05\/Copy-and-Paste-Queries-Across-Workbooks-04.png 1282w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2019\/05\/Copy-and-Paste-Queries-Across-Workbooks-04-300x246.png 300w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2019\/05\/Copy-and-Paste-Queries-Across-Workbooks-04-1024x840.png 1024w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2019\/05\/Copy-and-Paste-Queries-Across-Workbooks-04-768x630.png 768w\" sizes=\"(max-width: 1282px) 100vw, 1282px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #ff0000;\"><strong>STEP 4: <\/strong><\/span>In Workbook Queries, right click on the pane and <strong>select Paste<\/strong>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" title=\"Copy and Paste Queries Across Workbooks Using Power Query\"  class=\"aligncenter size-full wp-image-12434\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2019\/05\/Copy-and-Paste-Queries-Across-Workbooks-05.png\" alt=\"Copy and Paste Queries Across Workbooks Using Power Query\" width=\"525\" height=\"750\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2019\/05\/Copy-and-Paste-Queries-Across-Workbooks-05.png 525w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2019\/05\/Copy-and-Paste-Queries-Across-Workbooks-05-210x300.png 210w\" sizes=\"(max-width: 525px) 100vw, 525px\" \/><\/p>\n<p>You can now see the <strong>same query applied now without even creating the steps manually<\/strong>!<\/p>\n<p>The order date for this table as well has been split to <strong>Year, Month and Day!<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" title=\"Copy and Paste Queries Across Workbooks Using Power Query\"  class=\"aligncenter size-full wp-image-12435\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2019\/05\/Copy-and-Paste-Queries-Across-Workbooks-06.png\" alt=\"Copy and Paste Queries Across Workbooks Using Power Query\" width=\"1920\" height=\"798\" srcset=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2019\/05\/Copy-and-Paste-Queries-Across-Workbooks-06.png 1920w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2019\/05\/Copy-and-Paste-Queries-Across-Workbooks-06-300x125.png 300w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2019\/05\/Copy-and-Paste-Queries-Across-Workbooks-06-1024x426.png 1024w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2019\/05\/Copy-and-Paste-Queries-Across-Workbooks-06-768x319.png 768w, https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2019\/05\/Copy-and-Paste-Queries-Across-Workbooks-06-1536x638.png 1536w\" sizes=\"(max-width: 1920px) 100vw, 1920px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #0000ff;\"><strong>How to Copy and Paste Queries Across Workbooks Using Power Query<\/strong><\/span><\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/www.myexcelonline.com\/meo-staging\/100-39.html\" target=\"_blank\" rel=\"noopener noreferrer\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone\" src=\"https:\/\/www.myexcelonline.com\/meo-staging\/wp-content\/uploads\/2017\/07\/530x300.jpg\" alt=\"Free Excel Macros &amp; VBA Webinar Training\" width=\"530\" height=\"300\" title=\"\"><\/a><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Power Query or Get &amp; Transform (In Excel 2016) lets you perform a series of steps to transform your Excel data. \u00a0One 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 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":17421,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"cos_headline_score":0,"cos_seo_score":0,"cos_headline_text":"","cos_headline_has_been_analyzed":false,"cos_last_analyzed_headline":[],"om_disable_all_campaigns":false},"categories":[120,121],"tags":[596,117],"acf":[],"_links":{"self":[{"href":"https:\/\/www.myexcelonline.com\/meo-staging\/wp-json\/wp\/v2\/posts\/12424"}],"collection":[{"href":"https:\/\/www.myexcelonline.com\/meo-staging\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.myexcelonline.com\/meo-staging\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.myexcelonline.com\/meo-staging\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.myexcelonline.com\/meo-staging\/wp-json\/wp\/v2\/comments?post=12424"}],"version-history":[{"count":0,"href":"https:\/\/www.myexcelonline.com\/meo-staging\/wp-json\/wp\/v2\/posts\/12424\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.myexcelonline.com\/meo-staging\/wp-json\/wp\/v2\/media\/17421"}],"wp:attachment":[{"href":"https:\/\/www.myexcelonline.com\/meo-staging\/wp-json\/wp\/v2\/media?parent=12424"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.myexcelonline.com\/meo-staging\/wp-json\/wp\/v2\/categories?post=12424"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.myexcelonline.com\/meo-staging\/wp-json\/wp\/v2\/tags?post=12424"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}