+ Reply to Thread
Results 1 to 6 of 6

Converting listbox code to work with Listview

  1. #1
    Registered User
    Join Date
    05-23-2011
    Location
    New York, NY
    MS-Off Ver
    Excel 2010
    Posts
    79

    Question Converting listbox code to work with Listview

    Hello,

    I am new at VBA and I have just discovered the listview control. I would like to convert my listboxes to listview control to allow for sorting, columns, etc.

    I have the following code written to populate my three column listbox. Can someone please help me convert this to populate the listview?? I would also love to get some help on identifying the header names and sorting by clicking on the column header

    THANKS!!

    g


    Please Login or Register  to view this content.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Converting listbox code to work with Listview

    ListView Controls are totally differnt to ListBoxes & the additional problem is that they are not available on all computers so you could have problems if you intend distributing your workbooks.
    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
    05-23-2011
    Location
    New York, NY
    MS-Off Ver
    Excel 2010
    Posts
    79

    Re: Converting listbox code to work with Listview

    I actually will be distributing my form to a large audience. Thank you for the heads up.

    Can you help me with a code that will identify column headers from my workbook range in my listbox and allow the user to sort by clicking on the header? That is really all I wanted from the listview control.

    Thanks!!

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Converting listbox code to work with Listview

    Is this within the UserForm or on the sheet?

  5. #5
    Registered User
    Join Date
    05-23-2011
    Location
    New York, NY
    MS-Off Ver
    Excel 2010
    Posts
    79

    Re: Converting listbox code to work with Listview

    a listbox on a userform. I would like to populate it with the excel sheet range using the code posted above. I just need to add another column and allow for sorting (with headers)...thats where I am stuck

  6. #6
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Converting listbox code to work with Listview

    Take a look at my FilterForm example
    Thanks for the rep
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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