+ Reply to Thread
Results 1 to 2 of 2

Write Listbox selection to Multiple cells

  1. #1
    Registered User
    Join Date
    05-01-2004
    Posts
    8

    Write Listbox selection to Multiple cells

    I have created a list box, I would like the selection the user clicks on to then be copied to multiple cells.

    If i could get it to write to one cell I am sure I can figure out the rest.

    When the user selects the item it is in listbox1.value and listbox1.text but I have been unsuccesfull so far.

    here is the code:

    Sub RemoveDuplicates1()
    Dim AllCells As Range, Cell As Range
    Dim NoDupes As New Collection

    On Error Resume Next
    For Each Cell In Range("Data")
    NoDupes.Add Cell.Value, CStr(Cell.Value)
    Next Cell
    On Error GoTo 0
    UserForm1.Show

    End Sub


    I defined the worksheet and range in the listbox properties.

  2. #2
    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 eklarsen,

    Here is an example of how to set multiple cells equal to the list box value. The example uses a list box named ListBox1. The code in the click event will transfer the selected list item to 3 cells on Worksheet "Sheet1". Cells A2, B6, and C8 will equal what was seelcted in ListBox1. You can change the ListBox and Worksheet names to what you are using. Just place the code in the list box's Click event.

    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

+ 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