Results 1 to 10 of 10

Thread: [RESOLVED] List box

Threaded View

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2020
    Posts
    8

    Resolved [RESOLVED] List box

    Hello, i have problem , when ever i try to add info from cells to list box it also adds empty spaces, how could i change this?
    Here is my code


    Code:
    Private Sub CommandButton1_Click()
        ListBox1.Clear
    
    
        If TypeOf Selection Is Range Then
            For i = 1 To Selection.Rows.Count
                For j = 1 To Selection.Columns.Count
    
    
                    ListBox1.AddItem (Selection.Cells(i, j))
    
    
                Next
            Next
        End If
    
    End Sub
    Last edited by dday9; Dec 11th, 2020 at 10:52 AM. Reason: Added Code Tags

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width