hi everyone,
I want to use information ticked in a combobox in my excel spreadsheet using VBA. I.e., if you choose "add" and start the macro then vba add two or more numbers. If you choose "multiply" in the combobox then vba multiply them etc.
Can someone please tell me how to solve this with vba? I would be very thankful!
Cheers,
Rafael
Can use thisCode:Private Sub ComboBox1_Change() Select Case ComboBox1.Value Case "Multiply" TextBox3.Value = TextBox1.Value * TextBox2.Value TextBox4.Value = "*" Case "Divide" TextBox3.Value = TextBox1.Value / TextBox2.Value TextBox4.Value = "/" Case "Add" TextBox3.Value = TextBox1.Value + TextBox2.Value TextBox4.Value = "+" Case Else ' End Select End Sub Private Sub Worksheet_Activate() ComboBox1.AddItem "Multiply" ComboBox1.AddItem "Divide" ComboBox1.AddItem "Add" End Sub
Looking for great solutions but hate waiting?
Seach this Forum through Google
www.Google.com (e.g. +multiple +IF site:excelforum.com/excel-general/ )
www.Google.com (e.g. +fill +combobox site:excelforum.com/excel-programming/ )
Ave,
Ricardo
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks