+ Reply to Thread
Results 1 to 3 of 3

Power Query tables in VBA

  1. #1
    Forum Contributor
    Join Date
    11-01-2016
    Location
    Prague
    MS-Off Ver
    2013
    Posts
    121

    Power Query tables in VBA

    Hi Everyone,

    I have a table generated by Power query and in my VBA I have below code which is trying to refer "header row".

    Please Login or Register  to view this content.
    or

    Please Login or Register  to view this content.
    I tried both codes, but VBA is taking my second row instead of header. When I apply same code to a normal excel sheet which is not a table data, both codes is working perfectly.

    PS: The result of this macro is copy pasting some data to another excel sheet. So if its table macro is pasting second row. If its not table macro is pasting first row.)

    Do you know what is the reason and what would be a solution for this ?


    Thank you very much
    Orhan
    Last edited by orhanceliloglu; 04-26-2018 at 04:07 AM.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Power Query tables in VBA

    Orhan

    This works for me to select the header row of a table generated with Power Query.
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  3. #3
    Forum Contributor
    Join Date
    11-01-2016
    Location
    Prague
    MS-Off Ver
    2013
    Posts
    121

    Re: Power Query tables in VBA

    Quote Originally Posted by Norie View Post
    Orhan

    This works for me to select the header row of a table generated with Power Query.
    Please Login or Register  to view this content.
    Thank you Norie. But unfortunately, it didnt help still. I am sharing my all code below. Maybe if I kindly ask to review it, you can find the cause ?

    Basically, I have two range as header and source. And I am pointing for header the Range(Cells(1,1)) and for source I am pointing Range(Cell(2,1)), but some how VBA is pasting second row as header to the new file

    And if I change my Sheet1 with a non-table data. It is working. But I need to adjust this for table, since my source will be a power query.

    Please Login or Register  to view this content.
    Last edited by orhanceliloglu; 04-26-2018 at 08:48 AM.

+ 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. Sub-Forum for Power Query & Power BI?
    By AliGW in forum Suggestions for Improvement
    Replies: 7
    Last Post: 08-26-2018, 05:25 PM
  2. Replies: 0
    Last Post: 04-05-2018, 01:16 AM
  3. error in power query & power pivot
    By Baldev Kumar in forum Excel Charting & Pivots
    Replies: 8
    Last Post: 01-03-2018, 01:34 AM
  4. [SOLVED] Multiple tasks on tables in Power Query
    By wrybel in forum Excel General
    Replies: 11
    Last Post: 08-01-2017, 03:17 AM
  5. Get & Transform (Power Query) not showing certain tables
    By BamBamMoneyBags in forum Excel General
    Replies: 0
    Last Post: 03-22-2017, 12:22 PM
  6. Denesting tables in XML data imported into Power Query
    By Cuine100 in forum Excel General
    Replies: 1
    Last Post: 08-11-2016, 09:30 PM
  7. Power Query - how to append tables
    By GIS2013 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-25-2015, 04:55 AM

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