Results 1 to 5 of 5

Display Listbox values

Threaded View

  1. #3
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: Display Listbox values

    See attached for basic example using listboxes from Forms and Active-X controls.

    A Forms Listbox returns an index value to a linked cell, so you will need to do a look up in order to join the text strings.

    Basic code for Forms list box (assigned to a button). Linked cells are on row1, look up cells are on row2 and the code writes the string to cell A10.

    Sub Create_Text()
    
        Range("A10").Value = Range("A2").Text & " " & Range("B2").Text & " " & Range("C2").Text
    
    End Sub
    With an Active-X listbox you can directly join the value in the control.
    Private Sub CommandButton1_Click()
    
        With Me
            
            Sheet1.Range("A10").Value = .ListBox1.Value & " " & .ListBox2.Value & " " & .ListBox3.Value
            .Hide
        
        End With
    
    End Sub
    Attached Files Attached Files
    Palmetto

    Do you know . . . ?

    You can leave feedback and add to the reputation of all who contributed a helpful response to your solution by clicking the star icon located at the left in one of their post in this 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