Hi all,
am new to excel macro VB, I have a requirement , where i have the below data:
[TABLE="width: 320"]
<colgroup><col width="64" span="5" style="width:48pt"> </colgroup><tbody>[TR]
[TD="class: xl64, width: 64"]Number[/TD]
[TD="class: xl64, width: 64"]Value[/TD]
[TD="class: xl64, width: 64"]Number[/TD]
[TD="class: xl64, width: 64"]Value[/TD]
[TD="class: xl64, width: 64"]Difference[/TD]
[/TR]
[TR]
[TD="class: xl63, align: right"][TABLE="width: 256"]
<colgroup><col width="64" span="4" style="width:48pt"> </colgroup><tbody>[TR]
[TD="class: xl66, width: 64"]Number[/TD]
[TD="class: xl66, width: 64"]Value[/TD]
[TD="class: xl66, width: 64"]Number[/TD]
[TD="class: xl66, width: 64"]Value[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]113999[/TD]
[TD="class: xl65, align: right"]2475802[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]161717.6[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]115000[/TD]
[TD="class: xl65, align: right"]161717.6[/TD]
[TD="class: xl65, align: right"]113902[/TD]
[TD="class: xl65, align: right"]1611615[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]119140[/TD]
[TD="class: xl65, align: right"]21780.24[/TD]
[TD="class: xl65, align: right"]113999[/TD]
[TD="class: xl65, align: right"]2475284[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]119150[/TD]
[TD="class: xl65, align: right"]274086.8[/TD]
[TD="class: xl65, align: right"]119140[/TD]
[TD="class: xl65, align: right"]21780.24[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]119160[/TD]
[TD="class: xl65, align: right"]792537.1[/TD]
[TD="class: xl65, align: right"]119150[/TD]
[TD="class: xl65, align: right"]274086.8[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]119180[/TD]
[TD="class: xl65, align: right"]349912.7[/TD]
[TD="class: xl65, align: right"]119160[/TD]
[TD="class: xl65, align: right"]792537.9[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]119190[/TD]
[TD="class: xl65, align: right"]308752.5[/TD]
[TD="class: xl65, align: right"]119180[/TD]
[TD="class: xl65, align: right"]320793.7[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]119210[/TD]
[TD="class: xl65, align: right"]80364[/TD]
[TD="class: xl65, align: right"]119190[/TD]
[TD="class: xl65, align: right"]308752.5[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]119220[/TD]
[TD="class: xl65, align: right"]298546.5[/TD]
[TD="class: xl65, align: right"]119210[/TD]
[TD="class: xl65, align: right"]80364[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]119250[/TD]
[TD="class: xl65, align: right"]791109.7[/TD]
[TD="class: xl65, align: right"]119220[/TD]
[TD="class: xl65, align: right"]298546.5[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]119280[/TD]
[TD="class: xl65, align: right"]704297.7[/TD]
[TD="class: xl65, align: right"]119250[/TD]
[TD="class: xl65, align: right"]791109.7[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]119330[/TD]
[TD="class: xl65, align: right"]239020[/TD]
[TD="class: xl65, align: right"]119280[/TD]
[TD="class: xl65, align: right"]704297.7[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]180014[/TD]
[TD="class: xl65, align: right"]306944.2[/TD]
[TD="class: xl65, align: right"]119330[/TD]
[TD="class: xl65, align: right"]239020[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD="class: xl63, align: right"][/TD]
[TD="class: xl63, align: right"][/TD]
[TD="class: xl63, align: right"][/TD]
[TD="class: xl63"][/TD]
[/TR]
</tbody>[/TABLE]
Here 2 sets are there, i need to compare column1(Number) with column3(Number) and rearrange the whole table with matching Number values. For example i need the result as below:
[TABLE="width: 265"]
<colgroup><col><col span="3"></colgroup><tbody>[TR]
[TD]Number[/TD]
[TD]Value[/TD]
[TD]Number[/TD]
[TD]Value[/TD]
[/TR]
[TR]
[TD="align: right"]113999[/TD]
[TD="align: right"]2475802[/TD]
[TD="align: right"]113999[/TD]
[TD="align: right"]2475284[/TD]
[/TR]
[TR]
[TD="align: right"]115000[/TD]
[TD="align: right"]161717.6[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]119140[/TD]
[TD="align: right"]21780.24[/TD]
[TD="align: right"]119140[/TD]
[TD="align: right"]21780.24[/TD]
[/TR]
[TR]
[TD="align: right"]119150[/TD]
[TD="align: right"]274086.8[/TD]
[TD="align: right"]119150[/TD]
[TD="align: right"]274086.8[/TD]
[/TR]
[TR]
[TD="align: right"]119160[/TD]
[TD="align: right"]792537.1[/TD]
[TD="align: right"]119160[/TD]
[TD="align: right"]792537.9[/TD]
[/TR]
[TR]
[TD="align: right"]119180[/TD]
[TD="align: right"]349912.7[/TD]
[TD="align: right"]119180[/TD]
[TD="align: right"]320793.7[/TD]
[/TR]
[TR]
[TD="align: right"]119190[/TD]
[TD="align: right"]308752.5[/TD]
[TD="align: right"]119190[/TD]
[TD="align: right"]308752.5[/TD]
[/TR]
[TR]
[TD="align: right"]119210[/TD]
[TD="align: right"]80364[/TD]
[TD="align: right"]119210[/TD]
[TD="align: right"]80364[/TD]
[/TR]
[TR]
[TD="align: right"]119220[/TD]
[TD="align: right"]298546.5[/TD]
[TD="align: right"]119220[/TD]
[TD="align: right"]298546.5[/TD]
[/TR]
[TR]
[TD="align: right"]119250[/TD]
[TD="align: right"]791109.7[/TD]
[TD="align: right"]119250[/TD]
[TD="align: right"]791109.7[/TD]
[/TR]
[TR]
[TD="align: right"]119280[/TD]
[TD="align: right"]704297.7[/TD]
[TD="align: right"]119280[/TD]
[TD="align: right"]704297.7[/TD]
[/TR]
[TR]
[TD="align: right"]119330[/TD]
[TD="align: right"]239020[/TD]
[TD="align: right"]119330[/TD]
[TD="align: right"]239020[/TD]
[/TR]
[TR]
[TD="align: right"]180014[/TD]
[TD="align: right"]306944.2[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]161717.6[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD="align: right"]113902[/TD]
[TD="align: right"]1611615
[/TD]
[/TR]
</tbody>[/TABLE]
Could you please help me out with this? Read in the forum that it can be achieved using dictionary. But since am new here, could not proceed with it.
am new to excel macro VB, I have a requirement , where i have the below data:
[TABLE="width: 320"]
<colgroup><col width="64" span="5" style="width:48pt"> </colgroup><tbody>[TR]
[TD="class: xl64, width: 64"]Number[/TD]
[TD="class: xl64, width: 64"]Value[/TD]
[TD="class: xl64, width: 64"]Number[/TD]
[TD="class: xl64, width: 64"]Value[/TD]
[TD="class: xl64, width: 64"]Difference[/TD]
[/TR]
[TR]
[TD="class: xl63, align: right"][TABLE="width: 256"]
<colgroup><col width="64" span="4" style="width:48pt"> </colgroup><tbody>[TR]
[TD="class: xl66, width: 64"]Number[/TD]
[TD="class: xl66, width: 64"]Value[/TD]
[TD="class: xl66, width: 64"]Number[/TD]
[TD="class: xl66, width: 64"]Value[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]113999[/TD]
[TD="class: xl65, align: right"]2475802[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]161717.6[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]115000[/TD]
[TD="class: xl65, align: right"]161717.6[/TD]
[TD="class: xl65, align: right"]113902[/TD]
[TD="class: xl65, align: right"]1611615[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]119140[/TD]
[TD="class: xl65, align: right"]21780.24[/TD]
[TD="class: xl65, align: right"]113999[/TD]
[TD="class: xl65, align: right"]2475284[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]119150[/TD]
[TD="class: xl65, align: right"]274086.8[/TD]
[TD="class: xl65, align: right"]119140[/TD]
[TD="class: xl65, align: right"]21780.24[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]119160[/TD]
[TD="class: xl65, align: right"]792537.1[/TD]
[TD="class: xl65, align: right"]119150[/TD]
[TD="class: xl65, align: right"]274086.8[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]119180[/TD]
[TD="class: xl65, align: right"]349912.7[/TD]
[TD="class: xl65, align: right"]119160[/TD]
[TD="class: xl65, align: right"]792537.9[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]119190[/TD]
[TD="class: xl65, align: right"]308752.5[/TD]
[TD="class: xl65, align: right"]119180[/TD]
[TD="class: xl65, align: right"]320793.7[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]119210[/TD]
[TD="class: xl65, align: right"]80364[/TD]
[TD="class: xl65, align: right"]119190[/TD]
[TD="class: xl65, align: right"]308752.5[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]119220[/TD]
[TD="class: xl65, align: right"]298546.5[/TD]
[TD="class: xl65, align: right"]119210[/TD]
[TD="class: xl65, align: right"]80364[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]119250[/TD]
[TD="class: xl65, align: right"]791109.7[/TD]
[TD="class: xl65, align: right"]119220[/TD]
[TD="class: xl65, align: right"]298546.5[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]119280[/TD]
[TD="class: xl65, align: right"]704297.7[/TD]
[TD="class: xl65, align: right"]119250[/TD]
[TD="class: xl65, align: right"]791109.7[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]119330[/TD]
[TD="class: xl65, align: right"]239020[/TD]
[TD="class: xl65, align: right"]119280[/TD]
[TD="class: xl65, align: right"]704297.7[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]180014[/TD]
[TD="class: xl65, align: right"]306944.2[/TD]
[TD="class: xl65, align: right"]119330[/TD]
[TD="class: xl65, align: right"]239020[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD="class: xl63, align: right"][/TD]
[TD="class: xl63, align: right"][/TD]
[TD="class: xl63, align: right"][/TD]
[TD="class: xl63"][/TD]
[/TR]
</tbody>[/TABLE]
Here 2 sets are there, i need to compare column1(Number) with column3(Number) and rearrange the whole table with matching Number values. For example i need the result as below:
[TABLE="width: 265"]
<colgroup><col><col span="3"></colgroup><tbody>[TR]
[TD]Number[/TD]
[TD]Value[/TD]
[TD]Number[/TD]
[TD]Value[/TD]
[/TR]
[TR]
[TD="align: right"]113999[/TD]
[TD="align: right"]2475802[/TD]
[TD="align: right"]113999[/TD]
[TD="align: right"]2475284[/TD]
[/TR]
[TR]
[TD="align: right"]115000[/TD]
[TD="align: right"]161717.6[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]119140[/TD]
[TD="align: right"]21780.24[/TD]
[TD="align: right"]119140[/TD]
[TD="align: right"]21780.24[/TD]
[/TR]
[TR]
[TD="align: right"]119150[/TD]
[TD="align: right"]274086.8[/TD]
[TD="align: right"]119150[/TD]
[TD="align: right"]274086.8[/TD]
[/TR]
[TR]
[TD="align: right"]119160[/TD]
[TD="align: right"]792537.1[/TD]
[TD="align: right"]119160[/TD]
[TD="align: right"]792537.9[/TD]
[/TR]
[TR]
[TD="align: right"]119180[/TD]
[TD="align: right"]349912.7[/TD]
[TD="align: right"]119180[/TD]
[TD="align: right"]320793.7[/TD]
[/TR]
[TR]
[TD="align: right"]119190[/TD]
[TD="align: right"]308752.5[/TD]
[TD="align: right"]119190[/TD]
[TD="align: right"]308752.5[/TD]
[/TR]
[TR]
[TD="align: right"]119210[/TD]
[TD="align: right"]80364[/TD]
[TD="align: right"]119210[/TD]
[TD="align: right"]80364[/TD]
[/TR]
[TR]
[TD="align: right"]119220[/TD]
[TD="align: right"]298546.5[/TD]
[TD="align: right"]119220[/TD]
[TD="align: right"]298546.5[/TD]
[/TR]
[TR]
[TD="align: right"]119250[/TD]
[TD="align: right"]791109.7[/TD]
[TD="align: right"]119250[/TD]
[TD="align: right"]791109.7[/TD]
[/TR]
[TR]
[TD="align: right"]119280[/TD]
[TD="align: right"]704297.7[/TD]
[TD="align: right"]119280[/TD]
[TD="align: right"]704297.7[/TD]
[/TR]
[TR]
[TD="align: right"]119330[/TD]
[TD="align: right"]239020[/TD]
[TD="align: right"]119330[/TD]
[TD="align: right"]239020[/TD]
[/TR]
[TR]
[TD="align: right"]180014[/TD]
[TD="align: right"]306944.2[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]161717.6[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD="align: right"]113902[/TD]
[TD="align: right"]1611615
[/TD]
[/TR]
</tbody>[/TABLE]
Could you please help me out with this? Read in the forum that it can be achieved using dictionary. But since am new here, could not proceed with it.