Consulting

Results 1 to 4 of 4

Thread: Value of Multi column combobox

  1. #1
    VBAX Regular
    Joined
    Sep 2011
    Posts
    78
    Location

    Value of Multi column combobox

    I have a multi combobox that lists Surname, Initials and Title from three columns on a worksheet. However, only the value of the first column, "Surname", is given when I read the value. Is it possible to access the values of all the columns simultaneously? If so, how is it done?

    All assistancae appreciated.

    Regards

    Zagrijs

  2. #2
    Try..[VBA]ListBox1.List(ListBox1.ListIndex, 1)
    ListBox1.List(ListBox1.ListIndex, 2)[/VBA]

  3. #3
    Mac Moderator VBAX Guru mikerickson's Avatar
    Joined
    May 2007
    Location
    Davis CA
    Posts
    2,778
    Set the .BoundColumn property of the ComboBox to 1 and the .TextColumn property to 2.

    Then [vba]MsgBox ComboBox1.Text & " " & ComboBox1.Value[/vba] will give the person's surname and initials.

    For more than two columns, Macrosian's approach of accessing both dimensions of the .List property is needed.

  4. #4
    VBAX Regular
    Joined
    Sep 2011
    Posts
    78
    Location
    Thanks. The help is appreciated

Posting Permissions

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