hey guys.. I want to create a macro that says to me that when the sum of Combobox3.value + Combobox4.value > 100 It sends me a error message..
the problem is when I insert a number in combobox4, no matter if sum of them is >100 or <100 it gives me the error message..
here it is the code..
Private Sub ComboBox4_Change()
If ComboBox3.Value + ComboBox4.Value > 100 Then
MsgBox ("Soma superior a 100%"), vbCritical, "Mensagem de Erro"
ComboBox4.Clear
ComboBox4.ListIndex = -1
Dim rcnt As Long ' codigo para a variavel ordem de extrusao ir à lista
rcnt = Folha5.Range("T" & Rows.Count).End(xlUp).Row
For i = 2 To rcnt
ComboBox4.AddItem Folha5.Range("T" & i)
Next
End If
If ComboBox4.Value > 0 And ComboBox4.Value < 100 Then
TextBox10.Enabled = True
End If
thanks a lot
Bookmarks