excel vba
The UK's Number 1 for Microsoft Office Training Add this page to your favourites/bookmarksBookmark page
 
View printable version of pagePrintable version
Plus One Google
Customer: Sign in
Delegate: Sign in
Trainer: Log in

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Excel VBA

Excel VBA

resolvedResolved · High Priority · Version 2007

replyReply Wed 12 Oct 2011, 15:26Delegate Steve said...

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

For upcoming training course dates see: Pricing & availability

replyReply Mon 17 Oct 2011, 16:17Trainer Mark said...

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

 

Please browse our web site to find out more about
best training excel vba and other Microsoft training courses.

Excel tip:

Number format shortcut

Ctrl+Shift+! applies the Number format, with two decimal places

View all Excel hints and tips


Microsoft Certified Partner Accredited Training Provider: Institute of IT Training Institute of Leadership and Management - Certified Courses Security Seal verified by visa, mastercard securecard