Writing a Regex Macro that - stores matches , compares matches , and merges exact and similar values

joellen

New Member
Joined
Sep 7, 2018
Messages
4


(?<word> \w{4,})
This is a php code that does exactly what I want my macro to do. String together characters a-z and 0-9 (not case sensitive) and match words when they are equal to or greater than 4 characters. I am not sure how to get this code into VBA's language. I need it to loop through a column, find matches, and compare those matches to each other. If they words are a 100% match in two cells I would like them to automatically combine values. If the matched words are similar in two cells, I want it to ask the user if they would like to merge these values together.


Ex:

Project NameTotal Hours
Mowing the lawn2
Watering the lawn3
Planting Trees5
Mowing the lawn2
Planting Tree3

<tbody>
</tbody>


message box:
Planting Trees matched with Planting Tree, would you like to combine these Files? Yes=True No=False
If true, do
If false, do nothing

end result if user picked yes:

Project NameTotal Hours
Mowing the lawn4
Watering the lawn3
Planting Trees8

<tbody>
</tbody>



end result if user picked no:


Project NameTotal Hours
Mowing the lawn4
Watering the lawn3
Planting Trees5
Planting Tree3

<tbody>
</tbody>








</word>




 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.

Forum statistics

Threads
1,214,649
Messages
6,120,728
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