+ Reply to Thread
Results 1 to 4 of 4

Problem with outputting only certain columns from array

  1. #1
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Poland
    MS-Off Ver
    Excel 2016-365
    Posts
    2,940

    Problem with outputting only certain columns from array

    Hi Guys,

    i want to output array using application.index but i can not acheve it.

    Into G2 i want to output only Col4 and Col5 range.

    my code:

    Please Login or Register  to view this content.
    how to do this?

    Best,
    Jacek
    Attached Images Attached Images
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Problem with outputting only certain columns from array

    The simplest solution is to output the whole array and then delete the columns that you are not interested in.

    VBA does not allow you to extract a column or a row from an array.

    The only other way is to create a second array and use for next loops to copy your data to this second array.

    You can then output the second array.

    Or you could create the Second arrar directly from your data by only reading the last two columns.

    Please Login or Register  to view this content.

    Please Login or Register  to view this content.
    Last edited by mehmetcik; 10-28-2021 at 03:40 PM.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  3. #3
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: Problem with outputting only certain columns from array

    For 2d array, if one of the argument of the 2nd & 3rd is array, both needs to be array and 2nd must be 2d, 3rd need to be 1d.
    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Poland
    MS-Off Ver
    Excel 2016-365
    Posts
    2,940

    Re: Problem with outputting only certain columns from array

    Thank you!

    Jacek

+ 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. Outputting array into another woeksheet
    By jaryszek in forum Excel Programming / VBA / Macros
    Replies: 23
    Last Post: 05-30-2020, 10:44 AM
  2. [SOLVED] Outputting array from dictionary items
    By jaryszek in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-01-2020, 05:33 AM
  3. [SOLVED] Outputting second array dimension to range
    By jaryszek in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-15-2019, 03:47 AM
  4. Outputting Array into Range
    By awan0126 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-20-2011, 03:37 PM
  5. referencing an array and outputting
    By demuro1 in forum Excel General
    Replies: 0
    Last Post: 10-09-2008, 03:39 PM
  6. outputting an array
    By demuro1 in forum Excel General
    Replies: 2
    Last Post: 10-05-2008, 09:54 PM
  7. Outputting the contents of an array
    By carg1 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-28-2005, 02:05 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