How to use VBA sort 3 fields and merge first field

shi353

New Member
Joined
Dec 10, 2016
Messages
7
Want sort F2 F3 F4 first , merge F2 then count first item show happen counts and belongings date
Second picture show my wanted result

Can VBA do it ?Please help

Raw data below


<tbody>
[TD="class: xl70"]F1[/TD]
[TD="class: xl70, width: 63"]F2[/TD]
[TD="class: xl70, width: 63"]F3[/TD]
[TD="class: xl70, width: 117"]F4[/TD]

[TD="class: xl67"]1[/TD]
[TD="class: xl66"]Mary[/TD]
[TD="class: xl66"]M[/TD]
[TD="class: xl69"]2019/2/2[/TD]

[TD="class: xl67"]2[/TD]
[TD="class: xl68"]Wang[/TD]
[TD="class: xl68"]FM[/TD]
[TD="class: xl69"]2019/2/3[/TD]

[TD="class: xl67"]3[/TD]
[TD="class: xl66"]Mary[/TD]
[TD="class: xl66"]M[/TD]
[TD="class: xl69"]2019/2/4[/TD]

[TD="class: xl67"]4[/TD]
[TD="class: xl71"]Chang[/TD]
[TD="class: xl68"]M[/TD]
[TD="class: xl69"]2019/2/5[/TD]

[TD="class: xl67"]5[/TD]
[TD="class: xl66"]Mary[/TD]
[TD="class: xl66"]M[/TD]
[TD="class: xl69"]2019/2/6[/TD]

[TD="class: xl67"]6[/TD]
[TD="class: xl68"]Wang[/TD]
[TD="class: xl68"]FM[/TD]
[TD="class: xl69"]2019/2/7[/TD]

[TD="class: xl67"]7[/TD]
[TD="class: xl68"]Wang[/TD]
[TD="class: xl68"]FM[/TD]
[TD="class: xl69"]2019/2/8[/TD]

[TD="class: xl67"]8[/TD]
[TD="class: xl65"]Mary[/TD]
[TD="class: xl65"]FM[/TD]
[TD="class: xl69"]2019/2/9[/TD]

[TD="class: xl67"]9[/TD]
[TD="class: xl68"]Wang[/TD]
[TD="class: xl68"]FM[/TD]
[TD="class: xl69"]2019/2/10[/TD]

[TD="class: xl67"]10[/TD]
[TD="class: xl65"]Mary[/TD]
[TD="class: xl65"]FM[/TD]
[TD="class: xl69"]2019/2/11[/TD]

[TD="class: xl67"]11[/TD]
[TD="class: xl65"]Mary[/TD]
[TD="class: xl65"]FM[/TD]
[TD="class: xl69"]2019/2/12[/TD]

</tbody>
 
Last edited by a moderator:

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
F1F2F3F4F5F6
4ChangM2019/2/512019/2/5
8MaryFM2019/2/932019/2/9,2019/2/11,2019/2/12
10FM2019/2/11  
11FM2019/2/12  
1MaryM2019/2/232019/2/2,2019/2/4,2019/2/6
3
M2019/2/4  
5M2019/2/6  
2WangFM2019/2/342019/2/3,2019/2/7,2019/2/8,2019/2/10
6FM2019/2/7  
7FM2019/2/8  
9FM2019/2/10  

<colgroup><col style="mso-width-source:userset;mso-width-alt:2304; width:47pt" width="63" span="3"> <col style="mso-width-source:userset;mso-width-alt:4278;width:88pt" width="117"> <col style="mso-width-source:userset;mso-width-alt:2742;width:56pt" width="75"> <col style="mso-width-source:userset;mso-width-alt:10825;width:222pt" width="296"> </colgroup><tbody>
[TD="class: xl66, width: 63"][/TD]
[TD="class: xl66, width: 63"][/TD]
[TD="class: xl66, width: 117"][/TD]
[TD="class: xl79, width: 75"][/TD]
[TD="class: xl77, width: 296"][/TD]

[TD="class: xl65"][/TD]
[TD="class: xl80"][/TD]
[TD="class: xl67"][/TD]
[TD="class: xl70"][/TD]
[TD="class: xl78"][/TD]
[TD="class: xl72"][/TD]

[TD="class: xl65"][/TD]
[TD="class: xl68"][/TD]
[TD="class: xl68"][/TD]
[TD="class: xl70"][/TD]
[TD="class: xl71"][/TD]
[TD="class: xl73"][/TD]

[TD="class: xl65"][/TD]
[TD="class: xl68"][/TD]
[TD="class: xl70"][/TD]
[TD="class: xl71"][/TD]
[TD="class: xl73"][/TD]

[TD="class: xl65"][/TD]
[TD="class: xl68"][/TD]
[TD="class: xl70"][/TD]
[TD="class: xl71"][/TD]
[TD="class: xl73"][/TD]

[TD="class: xl65"][/TD]
[TD="class: xl69"][/TD]
[TD="class: xl69"][/TD]
[TD="class: xl70"][/TD]
[TD="class: xl71"][/TD]
[TD="class: xl74, width: 296"][/TD]

[TD="class: xl65"]Wanted Result! below
[/TD]
[TD="class: xl69"][/TD]
[TD="class: xl70"][/TD]
[TD="class: xl71"][/TD]
[TD="class: xl73"][/TD]

[TD="class: xl65"][/TD]
[TD="class: xl69"][/TD]
[TD="class: xl70"][/TD]
[TD="class: xl71"][/TD]
[TD="class: xl73"][/TD]

[TD="class: xl65"][/TD]
[TD="class: xl67"][/TD]
[TD="class: xl67"][/TD]
[TD="class: xl70"][/TD]
[TD="class: xl71"][/TD]
[TD="class: xl74, width: 296"][/TD]

[TD="class: xl65"][TABLE="width: 677"]
<colgroup><col span="3"><col><col><col></colgroup><tbody>[TR]

</tbody>
[/TD]
[TD="class: xl67"][/TD]
[TD="class: xl70"][/TD]
[TD="class: xl71"][/TD]
[TD="class: xl73"][/TD]
[/TR]
[TR]
[TD="class: xl65"][/TD]
[TD="class: xl67"][/TD]
[TD="class: xl70"][/TD]
[TD="class: xl71"][/TD]
[TD="class: xl73"][/TD]
[/TR]
[TR]
[TD="class: xl65"][/TD]
[TD="class: xl67"][/TD]
[TD="class: xl70"][/TD]
[TD="class: xl75"][/TD]
[TD="class: xl76"][/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0

Forum statistics

Threads
1,225,743
Messages
6,186,777
Members
453,370
Latest member
juliewar

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