+ Reply to Thread
Results 1 to 5 of 5

List display in userform

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    04-08-2009
    Location
    Bristol, UK
    MS-Off Ver
    Excel 2003
    Posts
    228

    List display in userform

    Quick question, I believe, How do you display lists within a label on a userform. Right now this is only displaying 1 cell. I need to have the background data in list form as I will be filtering it within the form later.

    Private Sub CommandButton1_Click()
    Label1.Caption = Worksheets("Sheet1").Range("B1").Value
    End Sub

    Also, if not a label, what would be the best way to display the list, as it will expand in future and something with a scroll would be prefered.

    Thanks.
    Attached Files Attached Files

  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: List display in userform

    A listbox would be best

    FilterForm.zip
    Hope that helps.

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

    Free DataBaseForm example

  3. #3
    Forum Contributor johnjohns's Avatar
    Join Date
    11-19-2007
    Location
    Dubai, UAE
    MS-Off Ver
    2003 and 2007
    Posts
    526

    Re: List display in userform

    As a quick reply, this is what I did for my list
    Private Sub UserForm_Initialize()
       BrandList.ColumnCount = ActiveWorkbook.Sheets("Controls").Range("ListBrandArea").Rows.Count
       BrandList.RowSource = "Controls!ListBrandArea"
    End Sub
    you can also make dropdown list in a cell, using data->validation. Only thing is if you refer another sheet for list contents, it should be a named range

    rgds

    johnjohns

  4. #4
    Forum Contributor johnjohns's Avatar
    Join Date
    11-19-2007
    Location
    Dubai, UAE
    MS-Off Ver
    2003 and 2007
    Posts
    526

    Re: List display in userform

    Sorry, forgot to mention, I used list box, not label

    rgds

    johnjohns

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

    Re: List display in userform

    The example shows how to poulate a Listbox & filter it using ComboBoxes

+ 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