vendredi 7 mai 2021

What to do on Compile Error: Else without if

Please Help. The VBA returns as compile error: else without if. can you point out my error?

Private Sub TextBox1_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
If (KeyAscii >= 47 And KeyAscii <= 58) Or KeyAscii = 46 Or KeyAscii = 32 Then KeyAscii = KeyAscii

Else
KeyAscii = 0
MsgBox "Invalid Input"

End Sub

Aucun commentaire:

Enregistrer un commentaire