Vba code for ComboBox UserForm

Big Lar

Well-known Member
Joined
May 19, 2002
Messages
557
A UserForm on my WS provides four ComboBoxes populated with a list of names in ColumnD
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p> </o:p>
Help needed to code CommandButton1_Click()...insert the four ComboBox values into cells AB2:AB5

Thanks
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
You mean something like this?

Code:
Private Sub CommandButton1_Click()
    Range("AB2").Value = UserForm1.ComboBox1.Value
    Range("AB3").Value = UserForm1.ComboBox2.Value
    Range("AB4").Value = UserForm1.ComboBox3.Value
    Range("AB5").Value = UserForm1.ComboBox4.Value
End Sub
 
Upvote 0
Code:
Private Sub CommandButton1_Click()
    
    With Worksheets("Sheet1")
        .Range("AB2").Value = ComboBox1.Value
        .Range("AB3").Value = ComboBox2.Value
        .Range("AB4").Value = ComboBox3.Value
        .Range("AB5").Value = ComboBox4.Value
    End With
    
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,594
Messages
6,179,795
Members
452,943
Latest member
Newbie4296

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top