Results 1 to 2 of 2

Thread: Loading a Column of Excel into a CheckedListBox

  1. #1

    Thread Starter
    Member
    Join Date
    Mar 2005
    Posts
    38

    Loading a Column of Excel into a CheckedListBox

    I got this far opening the excel sheet:

    VB Code:
    1. Dim excelsheet As New Application
    2.         Dim filepath As String
    3.         filepath = TextBox1.Text
    4.         excelsheet.Workbooks.Open(filepath)
    5.         Dim xlWsheet As Worksheet = excelsheet.Worksheets("Sheet1")
    6.         Dim r As Range = xlWsheet.UsedRange
    7.  
    8.         MsgBox(r.Cells(1, 1).Value)

    I get the first row displayed on the MessageBox, however that was for testing only. How would I go about placing all values in that column into a checked List Box? I am using VS 2005

  2. #2
    Frenzied Member Asgorath's Avatar
    Join Date
    Sep 2004
    Location
    Saturn
    Posts
    2,036

    Re: Loading a Column of Excel into a CheckedListBox

    Just do a cicle increasing the line number until you find an empty cell.
    Jorge
    "The dark side clouds everything. Impossible to see the future is."

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