Automating Power Query

tiredofit

Well-known Member
Joined
Apr 11, 2013
Messages
1,825
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
If you use Power Query to clean some data, can these steps be automated? For example, in Excel, I can click on the macro recorder, do something, then stop and see the something I did written in vba. Is there something equivalent in Power Query?
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
The steps you take in PQ are automatically added to the query, so I'm not sure I understand your question.
 
Upvote 0
The steps you take in PQ are automatically added to the query, so I'm not sure I understand your question.



In Excel, if I clicked on the macro recorder button, then typed in the value of 1 into cell A1, then stopped the recorder, I can see the code automatically generated.

So instead of typing in the value of 1 into cell A1 but I did some manipulating of data using power query such as these steps:

Click on Power Query option at the top
Click get data from web
Paste in a URL
Click OK to load the data

such as in this video:

Code:
https://www.wiseowl.co.uk/power-bi/videos/powerpivot/power-query/

does the vba show these steps?
 
Upvote 0
No it wouldn't. The steps are saved in the M code in power query. If you want to automate creating a new query, you can do that if you have a version that supports it, by using the Workbook.Queries.Add method (see for example here).
 
Upvote 0
No it wouldn't. The steps are saved in the M code in power query. If you want to automate creating a new query, you can do that if you have a version that supports it, by using the Workbook.Queries.Add method (see for example here).

Thanks, that's what I'm after.
 
Upvote 0

Forum statistics

Threads
1,213,539
Messages
6,114,221
Members
448,554
Latest member
Gleisner2

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top