troubleshooting Question

Macro that returns only the full string when searching a table containing partial strings as well

Avatar of John Carney
John CarneyFlag for United States of America asked on
Microsoft Excel
5 Comments1 Solution246 ViewsLast Modified:
Please take a look at the attached workbook and let me know how to modify the macro below so that it returns only the full string when its presence is detected in a table that includes partial strings as well.

In fact if there is a simpler way to zero in on any combo of 2 or more contiguous letters drawn from a set string (in this case "ABCDEFGHJKL") without the need for the table in the first place, please let me know that as well.

Sub FindStrings()
Dim cel As Range, x As Long, y As Long, z As String
x = [MyCell].Row
y = 50
    For Each cel In [Table1]
    If Len(cel) > 2 Then
         If InStr([MyCell], cel) > 0 Then
        Cells(x, y).End(xlToLeft).Offset(0, 1) = cel
        End If
    End If
End Sub
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 5 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros