Create query using power quering in Excel, but doing it with VBA code

sofiachr

Board Regular
Joined
Jan 15, 2013
Messages
98
Hi,

I want to create a query using power quering in Excel but I want to do it by using <acronym title="visual basic for applications" style="border-width: 0px 0px 1px; border-bottom-style: dotted; border-bottom-color: rgb(0, 0, 0); cursor: help; color: rgb(51, 51, 51); background-color: rgb(250, 250, 250);">VBA</acronym> code only. I have the following:


Worksheets("Lista Trebuchet").Select
Dim lastrowtrebuchet As Long
lastrowtrebuchet = Range("A" & Rows.Count).End(xlUp).Row
Range("A1:T" & lastrowtrebuchet).Select

Selection.Resize(Selection.<wbr style="color: rgb(51, 51, 51); background-color: rgb(250, 250, 250);">Rows.Count + 10, Selection.Columns.Count + 0).Select


Now this is the selection I want to create the query out of, how do I do this using only <acronym title="visual basic for applications" style="border-width: 0px 0px 1px; border-bottom-style: dotted; border-bottom-color: rgb(0, 0, 0); cursor: help; color: rgb(51, 51, 51); background-color: rgb(250, 250, 250);">VBA</acronym> code?

Thank you for your help!
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Hi,
If you have Excel 2016 (or maybe even 2013, not sure about that) you can use the Macro Recorder to record Power Query actions.
Does that help?
Olivier.
 
Upvote 0

Forum statistics

Threads
1,216,022
Messages
6,128,326
Members
449,441
Latest member
khankins

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