Re: Right(trim etc not returning expected result
expn = "CT Male Vitality Chemical Only May 2019"
given the above, if you want to retrieve the last two words irrespecitive of word length (May 2019) then this will do it in a single operation. So it works for June 2019, August 2019 etc.
Basically split the string using a space separator, then re-join the penultimate and last words.
Probably more efficient as a function, as this way splits the string 4 times, but it should still be pretty quick.
split(expn," ")(ubound(split(expn," "))-1) & " " & split(expn," ")(ubound(split(expn," ")))
Gemma was my dog
if a poster helps you, please click the scales at the bottom left of this posting, or use the thanks button alongside.