VBA Compare two strings, highlight differences

cgmojoco

Well-known Member
Joined
Jan 15, 2005
Messages
699
Hi there-

Example---how can I get the red highlighting to work like so?

<table x:str="" style="border-collapse: collapse; width: 187px; height: 90px;" border="0" cellpadding="0" cellspacing="0"><col style="width: 42pt;" span="2" width="56"> <tbody><tr style="height: 11.25pt;" height="15"> <td style="height: 11.25pt; width: 42pt;" width="56" height="15">Test</td> <td style="width: 42pt;" width="56">Test_002</td> </tr> <tr style="height: 11.25pt;" height="15"> <td class="xl22" style="background: silver none repeat scroll 0% 0%; height: 11.25pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" height="15">6698F</td> <td class="xl23" style="background: silver none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">ES6698F</td> </tr> <tr style="height: 11.25pt;" height="15"> <td class="xl22" style="height: 11.25pt;" height="15">DVP3142</td> <td class="xl22">DVP3144</td> </tr> <tr style="height: 11.25pt;" height="15"> <td class="xl22" style="background: silver none repeat scroll 0% 0%; height: 11.25pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" height="15">GTM8800</td> <td class="xl22" style="background: silver none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">GTI8000</td> </tr> <tr style="height: 11.25pt;" height="15"> <td class="xl22" style="height: 11.25pt;" height="15">SDV394</td> <td class="xl22">SV384STC</td> </tr> </tbody></table>
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.

Forum statistics

Threads
1,216,046
Messages
6,128,489
Members
449,455
Latest member
jesski

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