Userform drop down list text/value pairs

scottmcclean

New Member
Joined
Jul 2, 2014
Messages
23
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?
 

Some videos you may like

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.

onlyadrafter

Well-known Member
Joined
Aug 19, 2003
Messages
5,615
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.
 

Watch MrExcel Video

Forum statistics

Threads
1,102,757
Messages
5,488,668
Members
407,651
Latest member
Halosty

This Week's Hot Topics

  • Timer in VBA - Stop, Start, Pause and Reset
    [CODE=vba][/CODE] Option Explicit Dim CmdStop As Boolean Dim Paused As Boolean Dim Start Dim TimerValue As Date Dim pausedTime As Date Sub...
  • how to updates multiple rows in muliselect listbox
    Hello everyone. I need help with below code. code is only chaning 1st row in mulitiselect list box. i know issue with code...
  • Delete Row from Table
    I am trying to delete a row from a table using VBA using a named range to find what I need to delete. My Range is finding the right cell. In the...
  • Assigning to a variable
    I have a for each block where I want to assign the value in column 5 of the found row to the variable Serv. [CODE=vba] For Each ws In...
  • Way to verify information
    Hi All, I don't know what to call this formula, and therefore can't search. I have a spreadsheet with information I want to reference...
  • Active Cell Address – Inactive Sheet
    How to use VBA to get the cell address of the active cell in an inactive worksheet and then place that cell address in a location on the current...
Top