String length of Inputbox user input.

H

Hersh

Hi,
I want to return the string length of the input a user
gives in an inputbox in VBE. Any suggestions?
Hersh.
 
H

Harald Staff

Hi Hersh

Sub test()
Dim S As String
S = InputBox("Say what")
MsgBox Len(S) & " characters"
End Sub

Length 0 means no message or "Cancel", very useful to trap that event.
 
Top