Quantcast
Channel: Excel Help Forum - Excel Programming / VBA / Macros
Viewing all articles
Browse latest Browse all 50094

if statement to force user enter string without spacing

$
0
0
Hi guys, is there any way to force user to key in a string without spacing? Example if user input "test test", system will prompt error and force user to input "testtest". My code is like this

Code:

Sub Test()

text = Application.InputBox("Enter text", Type:=2)

' If text has space Then 
MsgBox("No spacing allowed")

End Sub

Is there any solution to it? Thanks in advance


Viewing all articles
Browse latest Browse all 50094

Trending Articles