combo box

-WS6-
03-28-2003, 02:52 PM
How do I pass information from a combo box to a cell in Excel?

I have a VBA program in Excel that is executed by clicking a macro button. It then brings up a dialog box with text boxes for entry of information. I've also added a combo box with 5 selections to choose from. When the user is finished filling in all the information and making a selection in the combo box, the user selects the OK button and all the information is passed to different cells on a spreadsheet. My problem is I don't know how to pass the information from the selection made in the combo box to a certain cell in the spreadsheet. Anyone have any suggestions? :huh:

italkid
03-28-2003, 04:46 PM
Private Sub CommandButton1_Click()
Range("A1").Value = ComboBox1.Text
End Sub

maddog1978
03-28-2003, 04:50 PM
The current item selected in the combo box is stored in the value property. If box is the name of combo box, the current selected item would be stored in box.value.

-WS6-
03-31-2003, 07:16 AM
Thanks, I had something out of place and now it works. :D

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum