PDA

View Full Version : Selecting 1 column data from Multicolumn-Combobox



simora
12-06-2009, 03:27 PM
I need to show a combobox on a userform with 2 columns of data that lists the states in the US. What I want to do is to show the full state name in the selection area of the combo box, along with the abbreviation, but send only the abbreviated representation to the spreadsheet.

So that for example New York is shown in the combo box & NY, but NY is sent to the worksheet when selected.

Whats the best way to set this up and impliment it?

Thanks

Bob Phillips
12-06-2009, 03:33 PM
Activecell.Value = ListBox1.List(ListBox1.ListIndex,1 )

simora
12-06-2009, 11:42 PM
Thanks xld:

But I'm not sure where your code goes. What will I enter for my Row source etc... ? My states are on sheet2 in cells A1:A50 and the corresponding abbreviations are in B1:B50

Bob Phillips
12-07-2009, 01:23 AM
My code is not for loadingthe listbox, it is for retriving the second column value. I had assumed that you had already loaded it.