Tricky regular expression
Am Thu, 16 May 2019 02:40:10 -0700 (PDT) schrieb RG III:
Hi Claus. Here's a different problem.
How can I test if a string begins with 1) one or more characters, 2) is followed by one or more whitespace characters, 3) and followed by any character string mixed with anything, including whitespaces?
Here are some example strings that meet the above criteria:
"what g. no 99"
Here are some example strings that do NOT meet the criteria:
"b9000 " ' There are no chars after the whitespaces
"abc" ' Missing whitespaces and chars at the end
"ab" ' Missing whitespaces and chars at the end
try it with this function:
Function StrChk(myRng As Range) As Boolean
Select Case Asc(Left(myRng, 1))
Case 97 To 122
Select Case Asc(Right(myRng, 1))
Case 48 To 122
If InStr(myRng, " ") 0 Then StrChk = True
If your string is in A1 call the function in the sheet with
If some strings don't work with that function, please poste the not
working examples. Then we must do it with Regular Expression.