Hi All,
I have a UserForm with 1 TextBox (TextBox1) And 3 Buttons, Exit Button, Clear All Button, Submit Button.
I have this code so that when a user inputs a number into TextBox1 it returns it in the UserForm as a percentage:
Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
TextBox1 = Format(Val(TextBox1.Value) / 100, "Percent")
If Val(TextBox1) > 100 Then
MsgBox "Fringe % Can Not Be Greater Than 100%."
Cancel = True
End If
End Sub
When I click the exit button, I get the error message "Type Mistmatch"
The code I have for my Exit Button is
Me.Hide
I'm not sure why this is happening.
Any help is greatly appreciated.
Thank you!
I have a UserForm with 1 TextBox (TextBox1) And 3 Buttons, Exit Button, Clear All Button, Submit Button.
I have this code so that when a user inputs a number into TextBox1 it returns it in the UserForm as a percentage:
Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
TextBox1 = Format(Val(TextBox1.Value) / 100, "Percent")
If Val(TextBox1) > 100 Then
MsgBox "Fringe % Can Not Be Greater Than 100%."
Cancel = True
End If
End Sub
When I click the exit button, I get the error message "Type Mistmatch"
The code I have for my Exit Button is
Me.Hide
I'm not sure why this is happening.
Any help is greatly appreciated.
Thank you!