ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   String length of Inputbox user input. (https://www.excelbanter.com/excel-programming/271621-string-length-inputbox-user-input.html)

Hersh

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


Harald Staff[_4_]

String length of Inputbox user input.
 
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.

--
HTH. Best wishes Harald
Excel MVP

Followup to newsgroup only please.

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




Henrik Wendel

String length of Inputbox user input.
 
dim TheLenght as Long
TheLenght= Len(Inputbox())

Wendel


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





All times are GMT +1. The time now is 09:42 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com