Yes, I am writing the value into the worksheet. I currently have a worksheet that has cell A as the value and B as the description of the positions. I would like to try your suggestion regarding the vlookup. Thanks
cb
Main Topics
Browse All TopicsI have a basic excel form that uses a drop down list of values from a worksheet and it appears to be working okay but I would like to be able to include the descriptions of the values on the list. Example: below is the drop down list values and descriptions of positions. I'd like to be able to have the list show RN, Phs Coordinator, etc for the user to select but it would write the values depending on what is selected. So the user would see RN, Data Analyst, etc...but when they select RN it would write 5004. Currently it displays and writes the numeric values. I have also included an example of my current code. Thanks
5004 RN
5005 PhsCoordinator
5006 Data Analyst
5007 Sr. Director Opp
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Actually I was just thinking about the userform combo box, and there is a way to store multiple columns of data in it, and select based on the first value, but store the second value? This might be easier for your to work with? You will need to set your columnscount property to 2, and set bound column to 2(Which will cause it to return the value of the second column). This will allow you store the name, and code, but then only return the code?
Will this work better?
I also have concerns with the vlookup, cause you may be populating more than one row of data? With knowing the structure of the storage sheet, I can't determine which way would be best for you.
Cal
I set the column property and bound to 2 on the combo box and changed the range in my code but it's not displaying the descritption and value side by side but instead vertically. Also, when I click save...it only enters the value if value is selected or the description if description is selected. Here's the range I changed vba code. Thanks.
cb
Dim MyUniqueList As Variant, i As Long
With cbo_pos
.Clear ' clear the listbox content
MyUniqueList = PosItemList(Sheet10.Range(
For i = 1 To UBound(MyUniqueList)
.AddItem MyUniqueList(i)
Next i
.ListIndex = 0 ' select the first item
End With
End Sub
From looking at your code, it looks like you are defining the combobox values from your spreadsheet. If that is the case, then this is very easy.
1. Add your combobox.
2. Open the properties.
3. Change BoundColumn to 2.
4. Change ColumnCount to 2.(Position Title MUST b the first column and position code the 2nd on your spreadsheet)
5. Change rowsource to A4:B100(Or whatever range your positions are stored in)
6. Change ControlSource to the cell you want to store the select value data in. SInce bound column is 2, you should get the second column of the combobox selection.
That should be it.
I've also whipped up some simple code to show how to load multi column data into a multi column combobox. Looks like the data needs to be stored in an array and then loaded to the combobox.
HTH
Cal
Thanks for the code. I'm unsure what you mean about "Change ControlSource to the cell you want to store the select value data in". The combo box is cbo_pos.value...is this where i add the controlSource? Could you give me an axample? Thanks
cb
Private Sub cmdOK_Click()
ActiveCell.Value = ActiveCell.Offset(-1, 0).Value + 1
ActiveCell.Offset(0, 1) = txt_fname.Value
ActiveCell.Offset(0, 2) = txt_lname.Value
ActiveCell.Offset(0, 3) = cbo_source1.Value
ActiveCell.Offset(0, 4) = cbo_pos.Value
Range("A2").Select
usr_form.txt_fname.SetFocu
Business Accounts
Answer for Membership
by: CbrinePosted on 2009-04-07 at 12:40:14ID: 24091077
When you say write, I'm assuming that you are taking the value from the user form combobox and storing it in a cell on the excel workbook? My suggestion would be populate the user form with the english description of the position, store that on the worksheet, then have a vlookup setup that will retrieve the position value from a vlookup table. If you are interested in this solution, let me know and I should be able to walk you through the vlookup setup.
HTH
Cal