• This topic is empty.
Viewing 1 post (of 1 total)
  • trying to get some combo boxes to work in VBA excel
  • mrmo
    Free Member

    Issue i have is that i can't figure out how to cope with a combo box where you dono't know the number of items before you create it. I assume that there must be away of showing the whole array of values and not just the first X regardless of whether there is or isn't any content.

    How?

    Private Sub combobox2_change()

    Range("c27").Select
    cellcb2 = ComboBox2.Value
    Do Until ActiveCell.Value = cellcb2
    ActiveCell.Offset(0, 1).Select

    Loop

    'workdown the list
    Do Until IsEmpty(ActiveCell)
    ActiveCell.Offset(1, 0).Select
    combo3(j) = ActiveCell.Value
    j = j + 1
    Loop

    ComboBox3.List = Array(combo3(1), combo3(2), combo3(3), combo3(4), combo3(5), combo3(6), combo3(7), combo3(8))

    Range("c38").Select
    cellcb3 = ComboBox2.Value
    Do Until ActiveCell.Value = cellcb3
    ActiveCell.Offset(0, 1).Select

    Loop

    'workdown the list
    Do Until IsEmpty(ActiveCell)
    ActiveCell.Offset(1, 0).Select
    combo4(k) = ActiveCell.Value
    k = k + 1
    Loop

    ComboBox4.List = Array(combo4(1), combo4(2), combo4(3), combo4(4), combo4(5), combo4(6), combo4(7), combo4(8))
    End Sub

Viewing 1 post (of 1 total)

The topic ‘trying to get some combo boxes to work in VBA excel’ is closed to new replies.