peter_sjogarde
Board Regular
- Joined
- Feb 13, 2012
- Messages
- 56
I have a VBA macro that looks for words that occur in strings. I do not want to match words that occur as part of other words, e.g. “bar” in barrier. I would like to match “ bar “ or “.Bar “ or “bar-“ “-bar”, i.e the word “bar”. Is there a function or application to do this?
Piece of code:
Piece of code:
Code:
For j = 2 To 16307
title = LCase(wosData(j, 2))
description = LCase(wosData(j, 3))
abstract = LCase(wosData(j, 4))
If InStr(1, title, keywords(i, 2), vbTextCompare) > 0 Or _
InStr(1, description, keywords(i, 2), vbTextCompare) > 0 Or _
InStr(1, abstract, keywords(i, 2), vbTextCompare) > 0 Then
'''do something'''
End If
Next j