Merge and Unmerge Cells

Bluwara

New Member
Joined
Nov 7, 2017
Messages
27
Morning all,

I want to know the vba code to merge and unmerge cells. The following table is the information I have.

[TABLE="class: grid, width: 500, align: left"]
<tbody>[TR]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Dropdown List

[TABLE="class: grid, width: 500, align: left"]
<tbody>[TR]
[TD]Code Name
[/TD]
[TD]Code No
[/TD]
[TD]Code Rate
[/TD]
[TD]Total Amount
[/TD]
[TD][/TD]
[TD]Drop Down List
[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]AB | 02 | 0.10%
[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]AC | 05 | 0.013%

[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]AF | 15
[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]BR | 65
[/TD]
[/TR]
</tbody>[/TABLE]


Merge option

Merge option

Unmerge option
Unmerge option



As you can see from the table, There is 1 drop down menu that has 2 different selection options. One is the merge option and the other is the unmerge option.

When I input a value from another cell, it triggers one of the 2 (merge or unmerge) options to show on the drop down list. This part I have done.

What I am trying to achieve is when the merged option is selected and when I pick an item from the drop down list, row cell from Code Name/Code No/Code Rate all merge. And then auto move on to the next row to fill another row with the next merge selection.

Likewise to the unmerge option, when I select an item from the drop down list the Code Name/Code No/Code Rate will be filled in from their drop down lists.

Hope this is clear and thanks in advance.


Bluwara
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.

Forum statistics

Threads
1,223,231
Messages
6,170,884
Members
452,364
Latest member
springate

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