Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- https://excel-egy.com/forum/t3942
- ---------------------------------
- Dim x, y
- Private Sub ComboBox1_Change()
- x = Application.Match(ComboBox1.Value, Columns(1), 0)
- If ComboBox1.Value = "" Then TextBox1.Value = ""
- If OptionButton1.Value = True Then OptionButton1_Click
- If OptionButton2.Value = True Then OptionButton2_Click
- End Sub
- Private Sub ComboBox3_Change()
- y = Application.Match(ComboBox3.Value, Columns(1), 0)
- If ComboBox3.Value = "" Then TextBox4.Value = ""
- If OptionButton1.Value = True Then OptionButton1_Click
- If OptionButton2.Value = True Then OptionButton2_Click
- End Sub
- Private Sub OptionButton1_Click()
- If ComboBox1.Value = "" Then TextBox1.Value = "": GoTo Skipper1
- If IsError(x) Then GoTo Skipper1
- If OptionButton1.Value = True Then
- OptionButton2.Value = False
- TextBox1.Value = Range("C" & x).Value
- End If
- Skipper1:
- If ComboBox3.Value = "" Then TextBox4.Value = "": GoTo Skipper2
- If IsError(y) Then GoTo Skipper2
- If OptionButton1.Value = True Then
- OptionButton2.Value = False
- TextBox4.Value = Range("C" & y).Value
- End If
- Skipper2:
- End Sub
- Private Sub OptionButton2_Click()
- If ComboBox1.Value = "" Then TextBox1.Value = "": GoTo Skipper1
- If IsError(x) Then GoTo Skipper1
- If OptionButton2.Value = True Then
- OptionButton1.Value = False
- TextBox1.Value = Range("D" & x).Value
- End If
- Skipper1:
- If ComboBox3.Value = "" Then TextBox4.Value = "": GoTo Skipper2
- If IsError(y) Then GoTo Skipper2
- If OptionButton2.Value = True Then
- OptionButton1.Value = False
- TextBox4.Value = Range("D" & y).Value
- End If
- Skipper2:
- End Sub
- Private Sub CommandButton1_Click()
- TextBox3.Value = TextBox2.Value * TextBox1.Value
- TextBox6.Value = TextBox5.Value * TextBox4.Value
- TextBox7.Value = Val(Val(TextBox6.Value) + Val(TextBox3.Value))
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement