Results 1 to 4 of 4
  1. #1
    Silver Lounger
    Join Date
    Dec 2000
    Location
    California, USA
    Posts
    1,758
    Thanks
    0
    Thanked 0 Times in 0 Posts

    ComboBox Selection (03)

    I have a Currency ComboBox which I would like to show the currency code selected and it's description from the dropdown. I can only get the currency code to display when selected; not both. If you click on the dropdown one can see both the currency code and description because the column count is set to 2.

    I know it can be done if I concatenate the cells in the rowsource but can it be done without the concatenation?

    You assistance is appreciated,
    John

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: ComboBox Selection (03)

    The list part of a combo box can display multiple columns but the text box part will only display the first column whose column width is non-zero. So if you want to use a combo box, concatenation is the only way to display both the code and the description in the text box part.
    As an alternative, you could use a list box instead of a combo box.

  3. #3
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: ComboBox Selection (03)

    John

    I have been off line as have had problems getting through. I have craeted this for you using an array which I think you may find useful:

    Dim CurrArray(2, 3) As String

    Private Sub UserForm_Initialize()
    Dim i, j, Rows As Single
    Dim CurrArray(74, 75) As String

    cboCurr.ColumnCount = 2
    Rows = ActiveSheet.UsedRange.Rows.Count

    For j = 1 To cboCurr.ColumnCount - 1
    For i = 1 To Rows - 1
    CurrArray(i, j) = Cells(i, j + 1).Value
    Next i
    Next j

    cboCurr.List() = CurrArray

    End Sub

    I have added the amended workbook for your delectation <img src=/S/grin.gif border=0 alt=grin width=15 height=15>
    Jerry

  4. #4
    Silver Lounger
    Join Date
    Dec 2000
    Location
    California, USA
    Posts
    1,758
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: ComboBox Selection (03)

    Jerry,

    Thank you for the code and advice.

    John

Posting Permissions

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