How to merge two cells without deleting data from the cell

>> Thursday 14 June 2012

How to merge two cells without deleting data from the cell
I am highlighting two cells in the same row, hitting format cells, alignment, merge cells and I'm getting the error message, "The selection contains multiple data values. Merging into one cell will keep the upper-left most data only." I want to be able to make the two separate cells one without deleting anything and without having to cut and paste.
Reply With Quote
#2
Old 05-01-2012
Hollyn Hollyn is offline
Member

Join Date: Jul 2011
Posts: 582
Re: How to merge two cells without deleting data from the cell
You can't, you can concatenate 2 cells into one by using a formula and ampersand =A1&" "&B1. However stay away from merging cells, always cause more problems than what it's worth and layout wise you can get very close without using it. I have never seen a power user using merging.
Reply With Quote
#3
Old 05-01-2012
RaaginiO RaaginiO is offline
Member

Join Date: Nov 2011
Posts: 91
Re: How to merge two cells without deleting data from the cell
Thank you so much for sending me this formula. It worked perfectly and did exactly what I needed. I really appreciate your quick, helpful response.
Reply With Quote
#4
Old 05-01-2012
Shurod Shurod is offline
Member

Join Date: Aug 2011
Posts: 599
Re: How to merge two cells without deleting data from the cell
So the answer is no, but there is a trick, you create a third cell, and you associate a CONCATENATE cells. ex: = CONCATENATE (C2, D2, E2) (associate cell content of C2 D2 E2). Just to mention one little thing on the response. The formula used to put in the same cell A1 and then the contents of a space and the contents of B1. If do not have space, simply remove & "" & which corresponds to "and commercial" button located on the one (at least on my keyboard).
Reply With Quote
#5
Old 05-01-2012
Panop Panop is offline
Member

Join Date: Aug 2011
Posts: 460
Re: How to merge two cells without deleting data from the cell
Excel offers the ability to summarize, cells. About the "Format - Cells - Alignment - Merge Cells", you can combine two cells into one unit. What do you do when two cells are located in content that does not want to lose you? Insert VBA to solve the task. The example in the following figure shows a short list of names. You want to summarize the contents of the two columns A and B in the first column A and then combine the two cells in columns A and B into one cell. The following macro does the job:
Dim row As Integer
Code:

Line = 1

While Not (IsEmpty (Cells (row, 1)))

Cells (row, 1) = Cells (row, 1) & "" & Cells (row, 2)

Cells (row 2). ClearContents

Range (Cells (row, 1), Cells (row, 2)). Merge

Row = row + 1

Applicable

Columns (1). AutoFit

End Sub

The macro loops through the lines from line 1 to column A appears in an empty content. For every non-empty content, the content of A and B (separated by a space) concatenated. Subsequently, the two cells A and B are connected to a cell.

0 comments:

Post a Comment

Read - Share - Comment

About This Blog

Share and Save

About Author