+ Reply to Thread
Results 1 to 4 of 4

VBA vs PowerQuery

  1. #1
    Registered User
    Join Date
    08-21-2012
    Location
    Iowa, USA
    MS-Off Ver
    Excel 2013
    Posts
    75

    VBA vs PowerQuery

    So I have some instances of the following in my workbook:

    Please Login or Register  to view this content.

    it works just fine so I dont need to fix it however I just recently started using powerquery and M language and such... So in that aspect of excel I am still very much a beginner so I am not entirely sure yet what I can and cant do with it.

    so what I would like to know is, am I doing this in the most efficient way or is there a better way to do it in powerquery.... I know I could also do it with formulas in cells but I discounted that idea a long time ago in favor of doing it in VBA and treat it like a SQL query, but at that point I only knew of those 2 options.

    If it makes any difference at all I can get the file Im referencing in my code in .csv, .sql and .yaml


    Thanks

  2. #2
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: VBA vs PowerQuery

    Hello,

    am I doing this in the most efficient way
    If you would care to put into plain English what "this" is, then people wouldn't have to read and interpret your code trying to figure out what you are actually doing.

    cheers, teylyn

  3. #3
    Registered User
    Join Date
    08-21-2012
    Location
    Iowa, USA
    MS-Off Ver
    Excel 2013
    Posts
    75

    Re: VBA vs PowerQuery

    ah sorry, basically all that is happening in that code is I am looking up a given number, and when it finds that number in a seperate file, which is very large, it spits out the name that goes with that number

    honestly its kindof a vba version of index(match) or vlookup

  4. #4
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: VBA vs PowerQuery

    Power Query will always return a table as a result. Of course you can create a query that opens a file and filters to a specific value in the numbers column, then removes all columns other than the name column and thus returns just the one name (if found). You can also use worksheet cells as parameters for the Power Query (file name, search term, etc).

    In the end it will be up to you to work out which method you prefer.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. PowerQuery and VBA
    By Trachr in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-08-2017, 12:10 AM
  2. Help with powerquery.
    By stephme55 in forum Excel General
    Replies: 0
    Last Post: 09-01-2016, 07:31 PM
  3. PowerQuery Keep Rows Between Two Row Criterias
    By wallstguy in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-10-2016, 02:05 AM
  4. PowerQuery - ECB currecy rate: CHF works USD fail
    By olasa in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-26-2015, 04:11 AM
  5. PowerQuery - how to get source settings?
    By illusionek in forum Excel General
    Replies: 0
    Last Post: 04-10-2015, 04:12 AM
  6. Where / How to get PowerQuery and PowerPivot for Excel 2010?
    By Xceller in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-29-2014, 12:58 PM
  7. Question about PowerQuery in Excel
    By venumadhavchagarla in forum Excel General
    Replies: 0
    Last Post: 05-07-2014, 04:50 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1