+ Reply to Thread
Results 1 to 4 of 4

Single Cell to ListBox

  1. #1
    Registered User
    Join Date
    09-07-2012
    Location
    earth
    MS-Off Ver
    Excel 2003
    Posts
    2

    Single Cell to ListBox

    Hello,

    I managed to write the code required to read from the ListBox to a single cell and separate each entry in the listbox by an Alt+Enter value (vbLf). The code for this is:

    Private Function LogListToSheet() As String

    Dim x As Integer
    Dim list As String
    x = 0

    For x = 0 To Log_List.ListCount - 1
    If x <> Log_List.ListCount - 1 Then _
    list = list & Log_List.Column(0, x) & vbLf _
    Else _
    list = list & Log_List.Column(0, x)
    Next

    LogListToSheet = list


    End Function


    So what I'm trying to do now is to read those values back into the ListBox and I'm not quite sure how to go about this.
    Last edited by echoedzephyr; 09-14-2012 at 01:24 PM.

  2. #2
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520

    Re: Single Cell to ListBox

    This should work

    Please Login or Register  to view this content.
    Thanks,
    Mike

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved.

  3. #3
    Registered User
    Join Date
    09-07-2012
    Location
    earth
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Single Cell to ListBox

    Yes! I didn't know about the split function (just started learning VBA). Thank you!

  4. #4
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520
    Your welcome

+ 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