Results 1 to 4 of 4

Thread: [RESOLVED] Load ComboBox Ignore Header Skip Blanks

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2009
    Location
    Los Angeles
    Posts
    1,335

    Resolved [RESOLVED] Load ComboBox Ignore Header Skip Blanks

    I want to load my combobox on sheet2 from data in sheet1

    The data in sheet1 will vary in size it also contains column headres that i dont want loaded into the combobox

  2. #2
    Just a Member! seenu_1st's Avatar
    Join Date
    Aug 2007
    Location
    India
    Posts
    2,170

    Re: Load ComboBox Ignore Header Skip Blanks

    i think u r using RowSource in combo, better use For Next loop, start loop from next row of the header, and if cell is not blank then add to combo.
    Seenu

    If this post is useful, pls don't forget to Rate this post.
    Pls mark thread as resolved once ur problem solved.
    ADO Tutorial Variable types SP6 for VB6, MsFlexGrid fast fill, Sorting Algorithms


  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2009
    Location
    Los Angeles
    Posts
    1,335

    Re: Load ComboBox Ignore Header Skip Blanks

    Quote Originally Posted by seenu_1st View Post
    i think u r using RowSource in combo, better use For Next loop, start loop from next row of the header, and if cell is not blank then add to combo.
    give you give me an example I can tweak?

  4. #4
    Just a Member! seenu_1st's Avatar
    Join Date
    Aug 2007
    Location
    India
    Posts
    2,170

    Re: Load ComboBox Ignore Header Skip Blanks

    something like this
    Code:
    Dim i As Long, LastRow As Long
    With Sheet1
        LastRow = .Cells(Rows.Count, "A").End(xlUp).Row
        For i = 2 To LastRow    'concidered row 1 as header
            If .Cells(i, "A") <> "" Then
                .ComboBox1.AddItem .Cells(i, "A")
            End If
        Next i
    End With
    Seenu

    If this post is useful, pls don't forget to Rate this post.
    Pls mark thread as resolved once ur problem solved.
    ADO Tutorial Variable types SP6 for VB6, MsFlexGrid fast fill, Sorting Algorithms


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