In my userform I want to MsgBox if TextBox not contain Numbers or empty.
This is my code but in another case when the TextBox = "" Empty the MsgBox appear to me, so the issue with me is the empty TextBox.
Private Sub TB1_Change()
If TypeName(Me.TB1) = "TextBox" Then
With Me.ActiveControl
L12.Caption = Val(TB1.Text) * Val(TB2.Text)
If Not IsNumeric(.Value) And .Value <> vbNullString Then
MsgBox "Sorry, only numbers allowed"
.Value = vbNullString
End If
End With
End If
End Sub

MsgBox "Sorry, only numbers allowed but you entered '" & .Value & "'."write in between'?With Me.ActiveControlbeWith Me.TB1- at the moment it is using the value of theActiveControlrather than the value of theTextBox.TB1_Changecode will be getting executed every time the user enters a character in the textbox (so 5 times if they type "hello") or deletes a character, and it is also getting called every time your code changes the value of the textbox (e.g. initialising it).