String length of Inputbox user input.

  • Thread starter Thread starter Hersh
  • Start date Start date
H

Hersh

Hi,
I want to return the string length of the input a user
gives in an inputbox in VBE. Any suggestions?
Hersh.
 
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.
 
Back
Top