I am trying to use the like function to distinguish between cells that begin (other than white space characters) with either 2 or 3 numerical digits followed by more white space characters, but seem to be having trouble identifying the latter. For example, for two cells, one containing
11 some text
and another containing
111 some text
I have been trying to write an if statement that is true for the first but not the second. I have tried
if cells(i,1) like "*##[ ]*" then
and
if cells(i,1) like "*##\s*" then
and
if cells(i,1) like "*##[^#]*" then
following information on using regex from various sources (with the first two I was trying to identify 2 digits followed by a white space character, and the third 2 digits followed by a non-digit).
It is part of a for loop, and as in the examples above, the only numerical digits are at the beginning of the string, other than sometimes white space characters. In the first code example the if statement is true for both 2 and 3 numerical digits, and for the second and third, it is true for neither. I don't understand this given what I have read about regex and the like function.
I would greatly appreciate guidance. I expected this to be relatively simple and so I'm sure I am missing something obvious, and apologies if this is the case.