+ Reply to Thread
Results 1 to 4 of 4

Copying some not all columns to an array

  1. #1
    Registered User
    Join Date
    05-15-2016
    Location
    Sydney
    MS-Off Ver
    excel 2013
    Posts
    21

    Copying some not all columns to an array

    Hi

    I know how to copy all data from a worksheet into an array but is there a way to copy just some columns? Lets say only copy data in columns A,F and I into a 2-d dynamic array

    The sheet i have has fixed column numbers but dynamic row numbers.

    Thanks heaps.
    Cheers

  2. #2
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Copying some not all columns to an array

    Hi,

    If your dataset has fewer than 65536 rows then you can achieve it using the INDEX worksheet function.
    Please Login or Register  to view this content.
    If you have a larger data set, you will have to loop to populate it. You might also use three arrays or one array that also contains the columns between the ones you need.
    Last edited by xlnitwit; 08-08-2016 at 10:35 AM. Reason: Grammar
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  3. #3
    Valued Forum Contributor
    Join Date
    03-22-2013
    Location
    Australia,NSW, Wirrimbi
    MS-Off Ver
    Excel 2013
    Posts
    1,057

    Re: Copying some not all columns to an array

    Look here:

    http://www.snb-vba.eu/VBA_Arrays_en.html

    Scroll down to:

    6.0.4.2 Filter certain 'columns'

  4. #4
    Registered User
    Join Date
    05-15-2016
    Location
    Sydney
    MS-Off Ver
    excel 2013
    Posts
    21

    Re: Copying some not all columns to an array

    Thanks!!!!!!!!!!!!!!!!!!!!!!

+ 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. VBA with Array not copying all the columns.
    By excellearner121 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-14-2014, 04:49 AM
  2. Replies: 3
    Last Post: 06-25-2013, 10:27 AM
  3. [SOLVED] Copying an Array
    By UNAB in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-26-2013, 08:16 PM
  4. Replies: 0
    Last Post: 09-15-2012, 02:56 AM
  5. Replies: 1
    Last Post: 08-07-2012, 07:47 PM
  6. Copying Array
    By yogeshmaney in forum Excel General
    Replies: 1
    Last Post: 02-26-2010, 03:55 AM
  7. [SOLVED] Copying an Array
    By BDH in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 02-21-2006, 12:15 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