Looping or iteration after doing conditional formatting on merged cells vba

Liyun

New Member
Joined
Nov 16, 2016
Messages
1
****** id="cke_pastebin" style="position: absolute; top: 0px; width: 1px; height: 1px; overflow: hidden; left: -1000px;">
0down votefavorite
I want a macro that can first identify top 3 value and merge these values together, and then find the next highest value from the merged cluster and then add the value to the cluster, and then continue to identify the next highest from the cluster = 1 iteration. Values identified in each iteration will be reflected in another column in order (ideally showing the value and the row name it came from)
<code style="margin: 0px; padding: 0px; border: 0px; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; white-space: inherit;">Eg. D1 D2 D3 D4

T1
5 6 10 8

T2
1 2 3 4

T3
5 6 7 9</code>Identify top 3 value: 10, 9, 8 and then merged together:
<code style="margin: 0px; padding: 0px; border: 0px; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; white-space: inherit;"> D1, D2, (D3, D4)
(T1, T3) 10 12 34
T2
1 2 7 </code>Then from the merged cluster, the next highest for row is D2, then add D2 to the cluster,
<code style="margin: 0px; padding: 0px; border: 0px; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; white-space: inherit;"> D1, (D2, D3, D4)
(T1, T3) 10 46
T2
1 9 </code>Then from the merged cluster, the next highest in terms of columns is T2, and it will run until all have been identified.
I want all the Ts identified in order to be shown in another column.
Eg, T1, T3, T2
I thought of using looping, but I couldn't do the macro out.
Please help thanks!



<tbody style="margin: 0px; padding: 0px; border: 0px;">
</tbody>
</body>

down votefavorite
I want a macro that can first identify top 3 value and merge these values together, and then find the next highest value from the merged cluster and then add the value to the cluster, and then continue to identify the next highest from the cluster = 1 iteration. Values identified in each iteration will be reflected in another column in order (ideally showing the value and the row name it came from)
<code style="margin: 0px; padding: 0px; border: 0px; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; white-space: inherit;">Eg. D1 D2 D3 D4

T1
5 6 10 8

T2
1 2 3 4

T3
5 6 7 9</code>Identify top 3 value: 10, 9, 8 and then merged together:
<code style="margin: 0px; padding: 0px; border: 0px; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; white-space: inherit;"> D1, D2, (D3, D4)
(T1, T3) 10 12 34
T2
1 2 7 </code>Then from the merged cluster, the next highest for row is D2, then add D2 to the cluster,
<code style="margin: 0px; padding: 0px; border: 0px; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; white-space: inherit;"> D1, (D2, D3, D4)
(T1, T3) 10 46
T2
1 9 </code>Then from the merged cluster, the next highest in terms of columns is T2, and it will run until all have been identified.
I want all the Ts identified in order to be shown in another column.
Eg, T1, T3, T2
I thought of using looping, but I couldn't do the macro out.
Please help thanks!



<tbody style="margin: 0px; padding: 0px; border: 0px;">
</tbody>
 

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,223
Messages
6,129,592
Members
449,520
Latest member
TBFrieds

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