Forum Discussion
Eduardo Rivera
May 16, 2018Copper Contributor
How to transfer values from multiple comboboxes from 1 userform using a commandbutton to a cell
I am trying to create a userform that has 5 comboboxes that are dependent on each other and once all fields are selected the user would press the commandbutton and the information in each box will po...
Matt Mickle
May 16, 2018Bronze Contributor
Eduardo-
I believe you can accomplish your task by completing the following :
Create a command button on your userform. Link it to this sub procedure:
Private Sub CommandButton1_Click()
Dim sht As Worksheet
'This is where you specify the sheet to put the UserForm Values....
Set sht = Sheets("Sheet1")
With sht
.Range("D6") = Me.ComboBox1.Value
.Range("F12") = Me.ComboBox2.Value
.Range("B4") = Me.ComboBox3.Value
End With
End Sub
When you click the command button it will move the values from your userform to the worksheet you specify.
Eduardo Rivera
May 16, 2018Copper Contributor
THANK YOU!!!! I have tried this code before and it didn't work.... but since I now know I'm not crazy I rebuilt my spreadsheet and it worked. Don't know why it was messed up but it wasn't working soooooo start from scratch. thanks again!!!
- Matt MickleMay 16, 2018Bronze Contributor
Eduardo-
Glad you were able to get it working! If you need more help feel free to post back to the community for more support. There are a lot of smart people on this forum that are always happy to help!