Modify a macro to add unique values (compare)

PTR2022

New Member
Joined
Dec 31, 2022
Messages
9
Office Version
  1. 365
Platform
  1. Windows
Hello!
Could you please help me?
Is there any way to modify this macro or make a new one to be able to compare the keyword column and the description column?
In the keyword column it is about comparing, as its name indicates, the words that have EXACTLY the same word, as you can see in cell C8 it is FALSE because it is missing the letter "A" to TexarkanA.

1675398026331.png

VBA Code:
Function Status(br1 As String, br2 As String) As Boolean
  Const PunctExcl As String = "( ) ' ," '<- List any characters to ignore with a space between each
  
  With CreateObject("VBScript.RegExp")
    .Global = True
    .Pattern = "\" & Replace(PunctExcl, " ", "|\")
    br2 = .Replace(Application.Trim(br2), "")
    .Pattern = "( |^)(" & Replace(.Replace(Application.Trim(br1), ""), " ", "|") & ")( |$)"
    Status = .Test(br2)
  End With
End Function
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.

Forum statistics

Threads
1,214,649
Messages
6,120,733
Members
448,987
Latest member
marion_davis

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top