vba string length

The solution for “vba string length” can be found here. The following code will assist you in solving the problem.

Dim myString as String
Dim arr() as String
Dim str_len as Integer

myString = “Come visit Mzansi over the holidays”
arr = Split(myString, ” “)
‘Compute string length i.e number of ‘words’
str_len = UBound(arr) – LBound(arr) + 1

Thank you for using DeclareCode; We hope you were able to resolve the issue.

More questions on [categories-list]

Similar Posts