+ Reply to Thread
Results 1 to 3 of 3

How to read only one column from a ListBox object? (into an array)

  1. #1
    Registered User
    Join Date
    11-27-2018
    Location
    Budapest
    MS-Off Ver
    2016
    Posts
    9

    How to read only one column from a ListBox object? (into an array)

    Hi!

    I have an activeX ListBox object on one of my sheets. I have a macro that pulls the list items from the ListBox and stores them in an array.
    For this purpose I am using:

    Please Login or Register  to view this content.
    My problem is that now I get a two-dimensional array (with lots of null columns), even though I only need the values from the first column of the ListBox (as a one-dimensional array).

    I tried using:

    Please Login or Register  to view this content.
    But this gives me only the first row of the first column (so only one item).
    Is there a way to store the items of a single column from the ListBox in a one-dimensional array?

    Thanks for all the help in advance!

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

    Re: How to read only one column from a ListBox object? (into an array)

    Try
    Please Login or Register  to view this content.
    Correction;
    Missed
    (as a one-dimensional array).
    Last edited by jindon; 12-19-2019 at 10:18 AM.

  3. #3
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,437

    Re: How to read only one column from a ListBox object? (into an array)

    Not a single dimension array but it is a single column.

    This should display 1st and last item in second column
    Please Login or Register  to view this content.
    Cheers
    Andy
    www.andypope.info

+ 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. [SOLVED] ListBox Array creates blank ListBox item
    By onmyway in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-16-2019, 12:33 PM
  2. How to read table in an array and populate a listbox with the array
    By waimea in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-01-2019, 11:43 AM
  3. Userform Listbox Column headers from recordset or array?
    By puuts in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-10-2016, 09:33 AM
  4. Trying to assign ListBox to object variable, but getting listbox value
    By JEA_123 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-12-2015, 05:45 AM
  5. Replies: 2
    Last Post: 08-16-2012, 01:41 PM
  6. [SOLVED] Listbox column headers when data is collected in an array
    By evertjvr in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-12-2012, 09:44 PM
  7. Replies: 2
    Last Post: 06-12-2006, 05:15 PM

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