Hi People
Basically I have a cbo which displays 1 to 5, I want to use the number selected and * by something else, basically how to I reference the option (number) selected in a cbo?
Hi People
Basically I have a cbo which displays 1 to 5, I want to use the number selected and * by something else, basically how to I reference the option (number) selected in a cbo?
HiOriginally Posted by CBrine
Yeah its a userform, For a example a user selects the "3" option from the cbo, this number is then included in some calculation, see what I mean
Just to show it in use Cal:
[VBA]TextBox1.Value = ComboBox1.Value * 5[/VBA]
Steve
"Nearly all men can stand adversity, but if you want to test a man's character, give him power."
-Abraham Lincoln
I want to use the value within the combo box to multiply the value, exampleOriginally Posted by lucas
private sub textbox1_afterupdate()
txttotal = txtcost.text * "value/option selected in the combo box"
the coding probably wont work, however I am just using it as an illustration
Why wouldn't you use your ComboBox_AfterUpdate event with your TextBox_AfterUpdate? Using them both and using a private sub to run would make things much easier. So when your combobox or your textbox is changed the routine would fire, keeping it much more dynamic.
HTH
Regards, Zack Barresse
Check out the KB! :|: BOARD TAGS: WHAT ARE THEY AND HOW DO I USE THEM
What is a Microsoft MVP? | Free Microsoft Courses | My Book on Excel Tables
[VBA]Private Sub ComboBox1_Change()
TextBox1.Value = ComboBox1.Value * TextBox2.Value
End Sub[/VBA]
Steve
"Nearly all men can stand adversity, but if you want to test a man's character, give him power."
-Abraham Lincoln