Userform drop down list text/value pairs

scottmcclean

New Member
Joined
Jul 2, 2014
Messages
33
Office Version
  1. 365
Platform
  1. Windows
Hi there,
I have a VBA userform that has two drop down lists and a text box. I currently have the first drop down list populated with Low, Medium, High and the sceond drop down list with Likely and Unlikely.I have the drop downs linked to a 2 column dynamic range - the second column has numeric values against the text values.

I would like the two numerical values multiplied and the answer to populate the text box.

I am not sure how to do this?
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Hello,

have assumed you are using Combobox's

put this code into the Userform code window

Code:
Private Sub ComboBox1_Change()
    If ComboBox2.Value <> "" Then
        TextBox1.Value = ComboBox1.Value * ComboBox2.Value
    End If
End Sub
Private Sub ComboBox2_Change()
    If ComboBox1.Value <> "" Then
        TextBox1.Value = ComboBox1.Value * ComboBox2.Value
    End If
End Sub

for the two comboboxes, in the properties window, you will need to change BoundColumn to 2.
 
Upvote 0

Forum statistics

Threads
1,213,560
Messages
6,114,306
Members
448,564
Latest member
ED38

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