In VBA, you can use len(string) function to find the length of the string or to count the number of characters in the string.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim strpass As String
strpass = InputBox("Enter your password:", "Password Length Checker")
If Len(strpass) < 8 Then
MsgBox "Too short!"
MsgBox "Good length!"
Posted by: Dara | post date: 02-25-2013 | Subject: VBA for MS Excel
This website intents to provide free and high quality tutorials, examples, exercises and solutions, questions and answers of programming and scripting languages: