Steve has attended:
Excel VBA Intro Intermediate course
Excel VBA
What is the best way to find a particular word in a string. The word always appears as the last word but the string length does vary. For example, how would I find the word "Total" in the below examples:
"Euro Conversion Total"
"Conversion Total"
I have tried using the "Instr" function but I am only able to get this to work if the target word appears at the front of the string:
If InStr(1, i, "Total", vbBinaryCompare) = 1 Then
Thanks
RE: Excel VBA
Hello Steve,
You may try using the wildcard in the criteria, such as "*total" to find anything that ends in total, or "*total*" to find it anywhere.
I hope this resolves your question. If it has, please mark this question as resolved.
If you require further assistance, please reply to this post. Or perhaps you have another Microsoft Office question?
Have a great day.
Regards,
Mark
Microsoft Office Specialist Trainer