(URGENT HELP)Sorting from horizontal to vertical

mambo84

New Member
Joined
Jan 7, 2010
Messages
15
Dear All

Need your help urgent. Am looking for a VBA or formula to do sorting from horizontal to vertical. Attached is a sample

Beside this, the process should ignore the yellow highlighted cell. There were thousand of Product category and branch.

Thanks in advance

<table border="0" cellpadding="0" cellspacing="0" width="1156"><colgroup><col style="width:48pt" width="64"> <col style="mso-width-source:userset;mso-width-alt:3547;width:73pt" width="97"> <col style="mso-width-source:userset;mso-width-alt:3693;width:76pt" width="101"> <col style="mso-width-source:userset;mso-width-alt:3291;width:68pt" width="90"> <col style="mso-width-source:userset;mso-width-alt:2194; width:45pt" span="3" width="60"> <col style="mso-width-source:userset;mso-width-alt:2230;width:46pt" width="61"> <col style="mso-width-source:userset;mso-width-alt:2889;width:59pt" width="79"> <col style="mso-width-source:userset;mso-width-alt:2596;width:53pt" width="71"> <col style="mso-width-source:userset;mso-width-alt:2230;width:46pt" width="61"> <col style="mso-width-source:userset;mso-width-alt:2633;width:54pt" width="72"> <col style="mso-width-source:userset;mso-width-alt:2267;width:47pt" width="62"> <col style="mso-width-source:userset;mso-width-alt:2011;width:41pt" width="55"> <col style="mso-width-source:userset;mso-width-alt:2084;width:43pt" width="57"> <col style="mso-width-source:userset;mso-width-alt:1536;width:32pt" width="42"> <col style="width:48pt" width="64"> </colgroup><tbody><tr style="height:15.75pt" height="21"> <td style="height:15.75pt;width:48pt" height="21" width="64">
</td> <td style="width:73pt" width="97">
</td> <td style="width:76pt" width="101">
</td> <td style="width:68pt" width="90">
</td> <td style="width:45pt" width="60">
</td> <td style="width:45pt" width="60">
</td> <td style="width:45pt" width="60">
</td> <td style="width:46pt" width="61">
</td> <td style="width:59pt" width="79">
</td> <td style="width:53pt" width="71">
</td> <td style="width:46pt" width="61">
</td> <td style="width:54pt" width="72">
</td> <td style="width:47pt" width="62">
</td> <td style="width:41pt" width="55">
</td> <td style="width:43pt" width="57">
</td> <td style="width:32pt" width="42">
</td> <td style="width:48pt" width="64">
</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">
</td> <td class="xl79">Branch Code</td> <td class="xl66">
</td> <td colspan="5" class="xl83" style="border-right:1.0pt solid black">Product Category A Code</td> <td>
</td> <td class="xl76">
</td> <td colspan="5" class="xl83" style="border-right:1.0pt solid black;border-left: none">Product Category B Code</td> <td>
</td> <td>
</td> </tr> <tr style="height:15.75pt" height="21"> <td style="height:15.75pt" height="21">
</td> <td class="xl77">
</td> <td class="xl68">
</td> <td class="xl67">A10001</td> <td class="xl68">B20001</td> <td class="xl68">C30001</td> <td class="xl68">D40001</td> <td class="xl69">E70003</td> <td>
</td> <td class="xl77">
</td> <td class="xl67" style="border-left:none">F90002</td> <td class="xl68">G300002</td> <td class="xl68">H60002</td> <td class="xl68">I70003</td> <td class="xl69">J15688</td> <td>
</td> <td>
</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">
</td> <td class="xl76" style="border-top:none">
</td> <td class="xl66" style="border-top:none">
</td> <td class="xl70" style="border-top:none">
</td> <td class="xl66" style="border-top:none">
</td> <td class="xl66" style="border-top:none">
</td> <td class="xl66" style="border-top:none">
</td> <td class="xl71" style="border-top:none">
</td> <td>
</td> <td class="xl76" style="border-top:none">
</td> <td class="xl70" style="border-top:none;border-left:none">
</td> <td class="xl66" style="border-top:none">
</td> <td class="xl66" style="border-top:none">
</td> <td class="xl66" style="border-top:none">
</td> <td class="xl71" style="border-top:none">
</td> <td>
</td> <td>
</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">
</td> <td class="xl78">
</td> <td>
</td> <td class="xl72">
</td> <td>
</td> <td>
</td> <td>
</td> <td class="xl73">
</td> <td>
</td> <td class="xl78">
</td> <td class="xl72" style="border-left:none">
</td> <td>
</td> <td>
</td> <td>
</td> <td class="xl73">
</td> <td>
</td> <td>
</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">
</td> <td class="xl78">B0123</td> <td>
</td> <td class="xl72" align="right">1001</td> <td>
</td> <td>
</td> <td align="right">5003</td> <td class="xl73">
</td> <td>
</td> <td class="xl78">
</td> <td class="xl72" style="border-left:none">
</td> <td align="right">1004</td> <td align="right">5004</td> <td>
</td> <td class="xl73" align="right">5003</td> <td>
</td> <td>
</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">
</td> <td class="xl78">C1234</td> <td>
</td> <td class="xl72" align="right">1002</td> <td align="right">5001</td> <td>
</td> <td class="xl65" align="right">5004</td> <td class="xl73">
</td> <td>
</td> <td class="xl78">
</td> <td class="xl72" style="border-left:none" align="right">5002</td> <td class="xl65" align="right">1005</td> <td align="right">5005</td> <td align="right">5004</td> <td class="xl73">
</td> <td>
</td> <td>
</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">
</td> <td class="xl78">D4567</td> <td>
</td> <td class="xl72">
</td> <td class="xl65" align="right">5002</td> <td>
</td> <td>
</td> <td class="xl73" align="right">5005</td> <td>
</td> <td class="xl78">
</td> <td class="xl72" style="border-left:none">
</td> <td>
</td> <td>
</td> <td align="right">5005</td> <td class="xl73">
</td> <td>
</td> <td>
</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">
</td> <td class="xl78">E4019</td> <td>
</td> <td class="xl72">
</td> <td>
</td> <td>
</td> <td align="right">5001</td> <td class="xl73">
</td> <td>
</td> <td class="xl78">
</td> <td class="xl72" style="border-left:none">
</td> <td align="right">5004</td> <td>
</td> <td>
</td> <td class="xl73" align="right">5004</td> <td>
</td> <td>
</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">
</td> <td class="xl78">G023u</td> <td>
</td> <td class="xl75" align="right">1005</td> <td>
</td> <td>
</td> <td align="right">5002</td> <td class="xl73">
</td> <td>
</td> <td class="xl78">
</td> <td class="xl72" style="border-left:none">
</td> <td align="right">5005</td> <td>
</td> <td>
</td> <td class="xl74" align="right">5005</td> <td>
</td> <td>
</td> </tr> <tr style="height:15.75pt" height="21"> <td style="height:15.75pt" height="21">
</td> <td class="xl77">H318u</td> <td class="xl68">
</td> <td class="xl67" align="right">1006</td> <td class="xl68">
</td> <td class="xl68" align="right">5005</td> <td class="xl68">
</td> <td class="xl69">
</td> <td>
</td> <td class="xl77">
</td> <td class="xl67" style="border-left:none">
</td> <td class="xl68">
</td> <td class="xl68">
</td> <td class="xl68">
</td> <td class="xl69">
</td> <td>
</td> <td>
</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> </tr> <tr style="height:15.75pt" height="21"> <td style="height:15.75pt" height="21">
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> </tr> <tr style="height:15.75pt" height="21"> <td style="height:15.75pt" height="21">
</td> <td class="xl80">Branch Code</td> <td class="xl81">Product Code</td> <td class="xl82">0QUANTITY</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">
</td> <td class="xl72">B0123</td> <td>A10001</td> <td class="xl73" align="right">1001</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">
</td> <td class="xl72">B0123</td> <td>D40001</td> <td class="xl73" align="right">5003</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">
</td> <td class="xl72">B0123</td> <td>G300002</td> <td class="xl73" align="right">1004</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">
</td> <td class="xl72">B0123</td> <td>H60002</td> <td class="xl73" align="right">5004</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">
</td> <td class="xl72">B0123</td> <td>J15688</td> <td class="xl73" align="right">5003</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">
</td> <td class="xl72">C1234</td> <td>A10001</td> <td class="xl73" align="right">1002</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">
</td> <td class="xl72">C1234</td> <td>B20001</td> <td class="xl73" align="right">5001</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">
</td> <td class="xl72">C1234</td> <td>F90002</td> <td class="xl73" align="right">5002</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">
</td> <td class="xl72">C1234</td> <td>H60002</td> <td class="xl73" align="right">5005</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">
</td> <td class="xl72">C1234</td> <td>I70003</td> <td class="xl73" align="right">5004</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">
</td> <td class="xl72">D4567</td> <td>E70003</td> <td class="xl73" align="right">5005</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">
</td> <td class="xl72">D4567</td> <td>I70003</td> <td class="xl73" align="right">5005</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">
</td> <td class="xl72">E4019</td> <td>D40001</td> <td class="xl73" align="right">5001</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">
</td> <td class="xl72">E4019</td> <td>G300002</td> <td class="xl73" align="right">5004</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">
</td> <td class="xl72">E4019</td> <td>J15688</td> <td class="xl73" align="right">5004</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">
</td> <td class="xl72">G023u</td> <td>D40001</td> <td class="xl73" align="right">5002</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">
</td> <td class="xl72">G023u</td> <td>G300002</td> <td class="xl73" align="right">5005</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">
</td> <td class="xl72">H318u</td> <td>A10001</td> <td class="xl73" align="right">1006</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> </tr> <tr style="height:15.75pt" height="21"> <td style="height:15.75pt" height="21">
</td> <td class="xl67">H318u</td> <td class="xl68">C30001</td> <td class="xl69" align="right">5005</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> </tr> </tbody></table>
 

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,224,585
Messages
6,179,696
Members
452,938
Latest member
babeneker

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