+ Reply to Thread
Results 1 to 3 of 3

Thread: listbox to cells??

  1. #1
    Registered User
    Join Date
    06-04-2006
    Posts
    28

    listbox to cells??

    i have a listbox in a userform were some text is in ( titles of books )
    sometimes this are 5 titles, sometimes 3 or 20.

    now i need a code that when i push a button, the titles are being copied to cells in a worksheet beginning from cel a1

    and my problem is, i don't know the right code.

    and its not:
    range("sheet1!a1") = listbox.text
    or .value

    plz help me

  2. #2
    Jim Cone
    Guest

    Re: listbox to cells??

    If you know how many items in the list (say 7) then try ...

    Worksheets("Sheet1").Range("A1:A7").Value = Me.ListBox1.List
    --
    Jim Cone
    San Francisco, USA
    http://www.realezsites.com/bus/primitivesoftware


    "tomro1" wrote in message
    i have a listbox in a userform were some text is in ( titles of books )
    sometimes this are 5 titles, sometimes 3 or 20.
    now i need a code that when i push a button, the titles are being
    copied to cells in a worksheet beginning from cel a1
    and my problem is, i don't know the right code.

    and its not:
    range("sheet1!a1") = listbox.text
    or .value
    plz help me
    --
    tomro1


  3. #3
    Valued Forum Contributor
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2010
    Posts
    1,091
    Dim i As Integer, n As Integer
    With Me.ListBox1
        For i = 0 To .ListCount - 1
            If .Selected(i) Then
                n = n + 1
                Sheets("Sheet1").Cells(n, "a").Value = .ListIndex(i)
            End If
         Next
    End With

+ 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.2.0