finnstone
asked on
need a macro to find the 2 letter word in a cell
i have 500000 rows on one column
i need a macro to identify which cells have the word "at" in them. BUT NOT IF ITS PART OF A LARGER WORD. just the word "at"
i need a macro to identify which cells have the word "at" in them. BUT NOT IF ITS PART OF A LARGER WORD. just the word "at"
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hi,
As a function to determine if here is a "at" alone
pls try
As a function to determine if here is a "at" alone
pls try
Function fIsAtPresent(Myrange As String) As Boolean
Dim regex As Object
Set regex = CreateObject("VBScript.RegExp")
Dim strInput As String
strInput = Myrange
With regex
.Global = True
.MultiLine = True
.IgnoreCase = True
.Pattern = "\bat\b"
End With
bRes = regex.Test(strInput)
fIsAtPresent = bRes
Set regex = Nothing
End Function
Regards
I'm glad I was able to help.
If you expand the “Full Biography” section of my profile you'll find links to some articles I've written that may interest you.
Marty - Microsoft MVP 2009 to 2016
Experts Exchange MVE 2015
Experts Exchange Top Expert Visual Basic Classic 2012 to 2016
If you expand the “Full Biography” section of my profile you'll find links to some articles I've written that may interest you.
Marty - Microsoft MVP 2009 to 2016
Experts Exchange MVE 2015
Experts Exchange Top Expert Visual Basic Classic 2012 to 2016
Open in new window