+ Reply to Thread
Results 1 to 5 of 5

ListBox Problem...

  1. #1
    Registered User
    Join Date
    07-23-2008
    Location
    Selangor
    Posts
    18

    ListBox Problem...

    i'm designing a form using macro. but i stuck when i want to view data from excel in list box.

    Name: ListBox1
    ColumnCount: 100
    ColumnBound: 100

    The function:
    when user click on cmbFindAll, all particular data for particular comName are listed in TextBox1. it's successful if only till 9th column. when i tried to put 10th column, the error will be occurred.
    could not set list property. invalid property value
    this is my coding

    Please Login or Register  to view this content.
    Last edited by VBA Noob; 07-31-2008 at 01:30 AM.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    I don't think that a listbox can have 100 Columns.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    07-23-2008
    Location
    Selangor
    Posts
    18
    so, what should i do? when i click 'Select', it only shows details from listbox1. not from db excel...

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259
    Hello collamack,

    In VBA you are limited to 10 columns (0 - 9) if your ListBox is unbound. To bind your ListBox to the worksheet use the RowSource property to define the range of interest. The maximum column limit for a bound control is 256.

    Sincerely,
    Leith Ross

  5. #5
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    100 Columns is not going to be very functional anyway! Leith's suggestion will not work in this case because the data you are trying to add is a filtered range. The only thing you could do to implement his suggestion is to copy the filtered range to another location then set the new range as the rowsource.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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