Macro Help To Find and Seperate Text

mohanyathish

New Member
Joined
Apr 21, 2011
Messages
48
[TABLE="class: grid, width: 500, align: left"]
<tbody>[TR]
[TD][TABLE="width: 219"]
<colgroup><col width="219"></colgroup><tbody>[TR]
[TD="class: xl65, width: 219"]Content
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 138"]
<colgroup><col width="138"></colgroup><tbody>[TR]
[TD="class: xl65, width: 138"]Number of Mentions[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 219"]
<colgroup><col width="219"></colgroup><tbody>[TR]
[TD="class: xl65, width: 219"]Mary is happy.[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 138"]
<colgroup><col width="138"></colgroup><tbody>[TR]
[TD="class: xl65, width: 138, align: right"]3[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 219"]
<colgroup><col width="219"></colgroup><tbody>[TR]
[TD="class: xl65, width: 219"]Honey is sweet.[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 138"]
<colgroup><col width="138"></colgroup><tbody>[TR]
[TD="class: xl65, width: 138, align: right"]4[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 219"]
<colgroup><col width="219"></colgroup><tbody>[TR]
[TD="class: xl65, width: 219"]Mary is married.[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 138"]
<colgroup><col width="138"></colgroup><tbody>[TR]
[TD="class: xl65, width: 138, align: right"]7[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 219"]
<colgroup><col width="219"></colgroup><tbody>[TR]
[TD="class: xl65, width: 219"]Mark was killed in an accident[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 138"]
<colgroup><col width="138"></colgroup><tbody>[TR]
[TD="class: xl65, width: 138, align: right"]12[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 219"]
<colgroup><col width="219"></colgroup><tbody>[TR]
[TD="class: xl65, width: 219"]Mark has a doctorate in English[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 138"]
<colgroup><col width="138"></colgroup><tbody>[TR]
[TD="class: xl65, width: 138, align: right"]5[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 219"]
<colgroup><col width="219"></colgroup><tbody>[TR]
[TD="class: xl65, width: 219"]"It is a wonderful day," said Mary.[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 138"]
<colgroup><col width="138"></colgroup><tbody>[TR]
[TD="class: xl65, width: 138, align: right"]2[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 219"]
<colgroup><col width="219"></colgroup><tbody>[TR]
[TD="class: xl65, width: 219"]Mark and Mary work together[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 138"]
<colgroup><col width="138"></colgroup><tbody>[TR]
[TD="class: xl65, width: 138, align: right"]8[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 219"]
<colgroup><col width="219"></colgroup><tbody>[TR]
[TD="class: xl65, width: 219"]"Mary" is a wonderful name.[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 138"]
<colgroup><col width="138"></colgroup><tbody>[TR]
[TD="class: xl65, width: 138, align: right"]15[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]




















I have the above data in excel.
Is it possible have a macro to find the "Top 3" number of mentions (In descending order) of "Mary" and "Mark", and move them into a new worksheet?

The result could be as below:

[TABLE="class: grid, width: 500, align: left"]
<tbody>[TR]
[TD][TABLE="width: 219"]
<colgroup><col width="219"></colgroup><tbody>[TR]
[TD="class: xl65, width: 219"]Content
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 138"]
<colgroup><col width="138"></colgroup><tbody>[TR]
[TD="class: xl65, width: 138"]Number of Mentions[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 219"]
<colgroup><col width="219"></colgroup><tbody>[TR]
[TD="class: xl65, width: 219"]"Mary" is a wonderful name.[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 138"]
<colgroup><col width="138"></colgroup><tbody>[TR]
[TD="class: xl65, width: 138, align: right"]15[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 219"]
<colgroup><col width="219"></colgroup><tbody>[TR]
[TD="class: xl65, width: 219"]Mary is married.
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 138"]
<colgroup><col width="138"></colgroup><tbody>[TR]
[TD="class: xl65, width: 138, align: right"]7[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 219"]
<colgroup><col width="219"></colgroup><tbody>[TR]
[TD="class: xl65, width: 219"]Mary is happy.
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 138"]
<colgroup><col width="138"></colgroup><tbody>[TR]
[TD="class: xl65, width: 138, align: right"]3[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]









[TABLE="class: grid, width: 500, align: left"]
<tbody>[TR]
[TD][TABLE="width: 64"]
<colgroup><col width="64"></colgroup><tbody>[TR]
[TD="class: xl65, width: 64"]Content
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 64"]
<colgroup><col width="64"></colgroup><tbody>[TR]
[TD="class: xl65, width: 64"]Number of Mentions
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 64"]
<colgroup><col width="64"></colgroup><tbody>[TR]
[TD="class: xl65, width: 64"]Mark was killed in an accident[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 64"]
<colgroup><col width="64"></colgroup><tbody>[TR]
[TD="class: xl65, width: 64, align: right"]12[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 64"]
<colgroup><col width="64"></colgroup><tbody>[TR]
[TD="class: xl65, width: 64"]Mark and Mary work together[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 64"]
<colgroup><col width="64"></colgroup><tbody>[TR]
[TD="class: xl65, width: 64, align: right"]8[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 64"]
<colgroup><col width="64"></colgroup><tbody>[TR]
[TD="class: xl65, width: 64"]Mark has a doctorate in English[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 64"]
<colgroup><col width="64"></colgroup><tbody>[TR]
[TD="class: xl65, width: 64, align: right"]5[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]



















Thanks in advance for your help.
 

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