Results 1 to 2 of 2
  1. #1
    3 Star Lounger
    Join Date
    Apr 2002
    Location
    Texas, USA
    Posts
    208
    Thanks
    0
    Thanked 1 Time in 1 Post

    VBA Code to use ListBox (2002)

    Looking for some sample VBA code to populate a multi-column ListBox on a form in Excel that includes column headers. No luck with searching Help for this in VBA/Excel.

    Thanks
    Ed

  2. #2
    Silver Lounger
    Join Date
    Dec 2000
    Location
    California, USA
    Posts
    1,758
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: VBA Code to use ListBox (2002)

    Ed,

    In the properties of the ListBox, set the "Column Heads" to True. The column heading of the range you choose to view will be displayed in the listbox as well as the range.

    Another neat feature is that you can change the width of each of the columns by entering in as an example 40 pt;180 pt;40 pt in "ColumnWidths"; that is to say if you have three columns to display. You're not restricted to pt (points) try using inches.

    John

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •