ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Merge vertically ? (https://www.excelbanter.com/excel-discussion-misc-queries/135324-merge-vertically.html)

bbelly

Merge vertically ?
 
The button "merge across" allows you to pick a group of cells, and
merges them along rows.

I need to pick a group of cells and have them merge in columns.

Perhaps someone has seen such a need, and has a code?

Thanks

ExcelBanter AI

Answer: Merge vertically ?
 
Yes, you can merge cells vertically in Excel using the "Merge & Center" option. Here are the steps to do so:
  1. Select the group of cells that you want to merge vertically.
  2. Right-click on the selected cells and choose "Format Cells" from the drop-down menu.
  3. In the "Alignment" tab, select "Center" under the "Vertical" section.
  4. Click on the "Merge & Center" button located in the "Alignment" tab.
  5. The selected cells will now be merged vertically.

Alternatively, you can use a keyboard shortcut to merge cells vertically. Here's how:
  1. Select the group of cells that you want to merge vertically.
  2. Press and hold the "Alt" key on your keyboard.
  3. While holding the "Alt" key, press "H", then "M", then "V".
  4. Release the "Alt" key.
  5. The selected cells will now be merged vertically.

Toppers

Merge vertically ?
 
It will merge columns too!

"bbelly" wrote:

The button "merge across" allows you to pick a group of cells, and
merges them along rows.

I need to pick a group of cells and have them merge in columns.

Perhaps someone has seen such a need, and has a code?

Thanks


bbelly

Merge vertically ? Clarification
 
Toppers wrote:
It will merge columns too!

"bbelly" wrote:


The button "merge across" allows you to pick a group of cells, and
merges them along rows.

I need to pick a group of cells and have them merge in columns.

Perhaps someone has seen such a need, and has a code?

Thanks


Perhaps you misunderstand my request?

Given a group of cells A1 - D4, applying 'merge across' to this group
creates four merged cells ...

_________________
| A1 B1 C1 D1 |
|________________|
| A2 B2 C2 D2 |
|________________|
| A3 B3 C3 D3 |
|________________|
| A4 B4 C4 D4 |
|________________|

I want to select this group, apply 'merge up&down'( 'merge vertical),
and get four cells merged thus ...

____________________
| A1 | A2 | A3 | A4 |
| | | | |
| B1 | B2 | B3 | B4 |
| | | | |
| C1 | C2 | C3 | C4 |
| | | | |
| D1 | D2 | D3 | D4 |
|____|____|____|____|

Hope that illustrates better.

Gord Dibben

Merge vertically ?
 
Use the "merge cells" button, not the "merge across" button.

Select the cells first then click on the button to merge vertically.

Then be prepared for the usual problems with merged cells.


Gord Dibben MS Excel MVP

On Sun, 18 Mar 2007 14:25:09 GMT, bbelly wrote:

The button "merge across" allows you to pick a group of cells, and
merges them along rows.

I need to pick a group of cells and have them merge in columns.

Perhaps someone has seen such a need, and has a code?

Thanks



Dave Peterson

Merge vertically ?
 
Option Explicit
Sub testme()
Dim myRng As Range
Dim myCol As Range
Set myRng = Selection
For Each myCol In myRng.Columns
myCol.Merge
Next myCol
End Sub

Select your range first, then run the macro.


bbelly wrote:

The button "merge across" allows you to pick a group of cells, and
merges them along rows.

I need to pick a group of cells and have them merge in columns.

Perhaps someone has seen such a need, and has a code?

Thanks


--

Dave Peterson

Gord Dibben

Merge vertically ? Clarification
 
What you want is "transpose"

Select A1:D4 and copy.

Select a cell out of the range and Paste SpecialTransposeOKEsc.

Then do the merge across.


Gord Dibben MS Excel MVP

On Sun, 18 Mar 2007 16:15:56 GMT, bbelly wrote:

Toppers wrote:
It will merge columns too!

"bbelly" wrote:


The button "merge across" allows you to pick a group of cells, and
merges them along rows.

I need to pick a group of cells and have them merge in columns.

Perhaps someone has seen such a need, and has a code?

Thanks


Perhaps you misunderstand my request?

Given a group of cells A1 - D4, applying 'merge across' to this group
creates four merged cells ...

_________________
| A1 B1 C1 D1 |
|________________|
| A2 B2 C2 D2 |
|________________|
| A3 B3 C3 D3 |
|________________|
| A4 B4 C4 D4 |
|________________|

I want to select this group, apply 'merge up&down'( 'merge vertical),
and get four cells merged thus ...

____________________
| A1 | A2 | A3 | A4 |
| | | | |
| B1 | B2 | B3 | B4 |
| | | | |
| C1 | C2 | C3 | C4 |
| | | | |
| D1 | D2 | D3 | D4 |
|____|____|____|____|

Hope that illustrates better.



Mike Rogers

Merge vertically ? Clarification
 
bbelly

Have you tried Toppers solution? Either we do not understand what you mean
by the "Merge Across" button or you have something that I don't. What
version of excel are you running? On xl2k I have "merge & center" button that
works both ways. Merges rows within a column and colums withing a row.

Mike Rogers



"bbelly" wrote:

Toppers wrote:
It will merge columns too!

"bbelly" wrote:


The button "merge across" allows you to pick a group of cells, and
merges them along rows.

I need to pick a group of cells and have them merge in columns.

Perhaps someone has seen such a need, and has a code?

Thanks


Perhaps you misunderstand my request?

Given a group of cells A1 - D4, applying 'merge across' to this group
creates four merged cells ...

_________________
| A1 B1 C1 D1 |
|________________|
| A2 B2 C2 D2 |
|________________|
| A3 B3 C3 D3 |
|________________|
| A4 B4 C4 D4 |
|________________|

I want to select this group, apply 'merge up&down'( 'merge vertical),
and get four cells merged thus ...

____________________
| A1 | A2 | A3 | A4 |
| | | | |
| B1 | B2 | B3 | B4 |
| | | | |
| C1 | C2 | C3 | C4 |
| | | | |
| D1 | D2 | D3 | D4 |
|____|____|____|____|

Hope that illustrates better.


bbelly

Merge vertically ?
 
Dave Peterson wrote:
Option Explicit
Sub testme()
Dim myRng As Range
Dim myCol As Range
Set myRng = Selection
For Each myCol In myRng.Columns
myCol.Merge
Next myCol
End Sub

Select your range first, then run the macro.


bbelly wrote:

The button "merge across" allows you to pick a group of cells, and
merges them along rows.

I need to pick a group of cells and have them merge in columns.

Perhaps someone has seen such a need, and has a code?

Thanks




Thanks ...

This is the answer to the question I was asking. I'll try it tomorrow.

Specifically, to pick a range, and have 'merge vertically' applied to
the lot, instead of picking two cells one on another, applying merge,
and repeating about 15 times for each affected row set.

Again, thank you

bbelly

Merge vertically ?
 
bbelly wrote:
Dave Peterson wrote:

Option Explicit
Sub testme()
Dim myRng As Range
Dim myCol As Range
Set myRng = Selection For Each myCol In myRng.Columns
myCol.Merge
Next myCol
End Sub

Select your range first, then run the macro.


bbelly wrote:

The button "merge across" allows you to pick a group of cells, and
merges them along rows.

I need to pick a group of cells and have them merge in columns.

Perhaps someone has seen such a need, and has a code?

Thanks





Thanks ...

This is the answer to the question I was asking. I'll try it tomorrow.

Specifically, to pick a range, and have 'merge vertically' applied to
the lot, instead of picking two cells one on another, applying merge,
and repeating about 15 times for each affected row set.

Again, thank you


Please be advised that I applied this code to a button, works like a charm !

Thank You


All times are GMT +1. The time now is 04:04 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com