Matching word phrases over different cells
Solved/Closed
localeman
-
May 27, 2011 at 08:54 AM
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 - May 27, 2011 at 10:21 AM
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 - May 27, 2011 at 10:21 AM
Related:
- Matching word phrases over different cells
- Ms word mod apk for pc - Download - Word processors
- Ms word pdf extension - Download - Other
- Word full screen - Guide
- Tick symbol in word - Guide
- Backspace not working in word - Guide
1 response
rizvisa1
Posts
4478
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
May 5, 2022
766
May 27, 2011 at 09:00 AM
May 27, 2011 at 09:00 AM
I think for that you have to code to do a fuzzy search. A lot depends on how the search should go. As you said "Good Food" and "Food Good" is a match. Then is "Food is Good" a match too. or "Good Mood" is a match ? depends
May 27, 2011 at 09:13 AM
May 27, 2011 at 09:30 AM
May 27, 2011 at 09:36 AM
May 27, 2011 at 10:21 AM
Sample Call : =isCommon("Food Good", "Good Food")
Public Function isCommon(ByVal sFindThis As String, ByVal sFindIn As String) As Boolean Dim sPreReplace As String Dim arrSplitFind As Variant Dim iWord As Variant Dim sWord As String Dim iRepCount As Integer If (sFindThis = sFindIn) _ Then isCommon = True GoTo isCommon_Exit End If sFindThis = Trim(sFindThis) Do sPreReplace = sFindIn sFindIn = Replace(sFindIn, " ", " ") Loop While (sPreReplace <> sFindIn) Do sPreReplace = sFindThis sFindThis = Replace(sFindThis, " ", " ") Loop While (sPreReplace <> sFindThis) arrSplitFind = Split(sFindThis, " ") For iWord = LBound(arrSplitFind) To UBound(arrSplitFind) sWord = Trim(arrSplitFind(iWord)) If (sWord <> vbNullString) _ Then sFindIn = " " & Trim(sFindIn) & " " sPreReplace = sFindIn sFindIn = Replace(sFindIn & " ", " " & sWord & " ", vbNullString, 1, 1) sFindIn = " " & Trim(sFindIn) & " " If (sPreReplace = sFindIn) _ Then isCommon = False GoTo isCommon_Exit End If End If Next_iWord: Next iWord isCommon = (Trim(sFindIn) = vbNullString) isCommon_Exit: End Function