Working with Merged Cells

raeannb

Board Regular
Joined
Jun 21, 2011
Messages
86
I've read all about how merged cells are the devil and no one should use them, but unfortunately someone more important than I am has decided that merged cells are prettier, and therefore are necessary. Hence: my problem. I hope I can explain this without confusing myself/everyone...oy. Here it goes:

The spreadsheet I'm using has several categories, each identified by a label in Column A that is made up of merged cells, and rotated 90 degrees. For a (hopefully) clarifying example, say I have categories "Pizza," "Pasta," and "Pie." The word "Pizza" is found sideways in Column A, merged over rows 1-5 which contain different types of pizza in Column B (B1 = Pepperoni, B2 = Cheese...you get the point, and I'm getting hungry). Below "Pizza" in Column A is another merged cell, merged over rows 6-10. This, of course, says "Pasta" and B6 = Linguini, B7 = Farfalle, B8 = Spaghetti...etc. Below "Pasta" is "Pie" over rows 11-15, and so on. Hopefully you get my point.

Now for my problem:

In order to update my spreadsheet (say someone just invented pineapple-guava-goatcheese-steak pizza and I need to add a row for it in the pizza category), I'd like to have two handy programs. First, I'd like to be able to unmerge the labels, and place the category name on each individual row of each section. This would mean that A1 = Pizza, B1 = Pepperoni; A2 = Pizza, B2 = Cheese...and so on. This way I can sort by category, but also by whatever the hey else I'd like to sort by.

Second, I'd like a program that will instantly re-do the beautiful merge job that my overlord requires, making all rows with the word "Pizza" in Column A merge together and turn 90 degrees.

I've never had to deal with merged cells in VB before, so I'm nervous and slightly frustrated. All attempts thus far have failed sadly. Any advice would be desperately welcome, and thank you very very very much in advance!
 
Doesn't that code unmerge the cells?

Is that what you were actually looking for?
 
Upvote 0

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
It's just the first part - I haven't gotten to the re-merging yet. Silly Tuesdays...so unfairly busy!
 
Upvote 0

Forum statistics

Threads
1,224,602
Messages
6,179,843
Members
452,948
Latest member
UsmanAli786

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