Check if there exists in an Excel sheet a string of length within several strings in cell -


i see if there exists string of length 25 in cell. problem cell want check, contains several strings seperated space. of these strings, want know if there string of length 25.

if use example len-function, total length of strings in cell, while want see if there indeed exists string of length 25 between strings in cell.

you need split string separate strings use len use split , loop through array of strings. code single cell check:

dim wrdarray() string dim testlen integer  ' cell , split separate strings in array wrdarray() = split(range("a1"))  ' loop strings array find equal 25 characters long = lbound(wrdarray) ubound(wrdarray)     testlen = len(wrdarray(i))     if (testlen = 25)         msgbox "found one"     end if next 

Comments