+ Reply to Thread
Results 1 to 9 of 9

Multi-column Listbox - Dynamic range - over 4,000 rows of data

  1. #1
    Forum Contributor
    Join Date
    12-19-2012
    Location
    Woodbridge, Virginia
    MS-Off Ver
    Excel 2010
    Posts
    111

    Multi-column Listbox - Dynamic range - over 4,000 rows of data

    All,

    I am trying to get a listbox to show 10 columns of data based on a few criteria. In my database, I currently have 4k rows of data that is comprised of companies, invoices, and payments. What I am trying to do with the listbox is show all of the invoices for a particular company. Later on, I would like to show only the outstanding invoices in the listbox but for now I want to attempt to just get some data in my listbox to appear. So far this is what I have:

    Please Login or Register  to view this content.
    When I run this code, the listbox shows blanks for half a page, then one line of invoice information, and then the rest of the page is filled with blanks.

    Can someone please help?

    Thank you in advance.

    J
    Last edited by s2jrchoi; 12-12-2013 at 03:59 PM.

  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: Multi-column Listbox - Dynamic range - over 4,000 rows of data

    What's the problem?
    If posting code please use code tags, see here.

  3. #3
    Forum Contributor
    Join Date
    12-19-2012
    Location
    Woodbridge, Virginia
    MS-Off Ver
    Excel 2010
    Posts
    111

    Re: Multi-column Listbox - Dynamic range - over 4,000 rows of data

    Hey Norie,

    When I run this code, the listbox shows blanks for half a page, then one line of invoice information, and then the rest of the page is filled with blanks. Why is it doing that?

    J

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

    Re: Multi-column Listbox - Dynamic range - over 4,000 rows of data

    You aren't using Redim Preserve which means every time you ReDim you lose all the data in the array.

    Give this a try.
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    12-19-2012
    Location
    Woodbridge, Virginia
    MS-Off Ver
    Excel 2010
    Posts
    111

    Re: Multi-column Listbox - Dynamic range - over 4,000 rows of data

    Hey Norie,

    Thanks for your help but I am getting a Run-time error '438': Object doesn't support this property or method. It is highlighting
    Please Login or Register  to view this content.
    Do you know why this could be happening?

    Thank you again.

    J
    Last edited by s2jrchoi; 12-12-2013 at 04:24 PM.

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

    Re: Multi-column Listbox - Dynamic range - over 4,000 rows of data

    Did you not notice that I switched the dimensions of the array around?

    It's now 1 To 10 by 1 To xBal and needs to be that way as you can only redimension the last dimension when using Redim preserve.

    So that line should be this
    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    12-19-2012
    Location
    Woodbridge, Virginia
    MS-Off Ver
    Excel 2010
    Posts
    111

    Re: Multi-column Listbox - Dynamic range - over 4,000 rows of data

    I found out the problem. It should have been Transpose not Tranpose..LOL..

    By any chance, do you know how to sort the listbox based on the first column of the listbox?

    Thank you for your help!!

  8. #8
    Forum Contributor
    Join Date
    12-19-2012
    Location
    Woodbridge, Virginia
    MS-Off Ver
    Excel 2010
    Posts
    111

    Re: Multi-column Listbox - Dynamic range - over 4,000 rows of data

    Yup I noticed that you switched the dimensions around..sorry about that..That's why I edited my reply to a different error that I got.

    Sorry again.

  9. #9
    Forum Contributor
    Join Date
    12-19-2012
    Location
    Woodbridge, Virginia
    MS-Off Ver
    Excel 2010
    Posts
    111

    Re: Multi-column Listbox - Dynamic range - over 4,000 rows of data

    Norie,

    The sorting is a different topic so I'll post that on a new thread. For now, my primary issue is resolved thanks to you.

    Thank you again for your help!!

    J

+ 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. Replies: 19
    Last Post: 10-05-2012, 01:03 PM
  2. Delete Autofiltered rows from multi-column Listbox
    By kriswhiteley in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-03-2012, 08:46 AM
  3. How to use multi-column ListBox?
    By Treacle in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-16-2010, 05:18 AM
  4. Multi-Column Dynamic Named Range...Is there an easier way?
    By Ken Johnson in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 04-22-2006, 09:00 PM
  5. Dynamic Multi Column ListBox
    By Ronbo in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-11-2005, 06:06 PM

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