How to combine 2 or more cells in Excel without losing data

When merging cells containing data into 1 cell, Excel retains the data in the first cell only, data in the remaining cells are deleted. So to retain all data in the cells you need to merge, you can not use the Merge feature in Excel but need to use it in a different way. The following article details instructions How to combine 2 or more cells in Excel without losing data.

For example, with the collected population list, it is necessary to combine the field of first and last names into 1 cell and retain all the data. Especially when every school full name and first name of an individual automatically enter the line.

How to combine 2 or more cells in Excel without losing data Picture 1

For example, here, Nguyen Van An and Le Thi My share the same weapon to make 2 cells to make one cell, especially Le Thi My Chi automatically goes down the line:

How to combine 2 or more cells in Excel without losing data Picture 2

To combine two or more cells in Excel to ensure no data loss, follow these steps:

Step 1: Open the Excel file containing the data to merge -> press Alt + F11 to open the VBA editor to create Macros -> on the Insert tab -> Module:

How to combine 2 or more cells in Excel without losing data Picture 3

Step 2: Enter the following code content, with the module name MrgCll:

 Sub MrgCll () Dim Cll As Range, Temp As String Application.DisplayAlerts = False On Error Resume Next If Selection.MergeCells = False Then For Each Cll In Selection If Cll <> "" Then Temp = Temp + Cll.Text + vbcrlf Next Cll Selection.Merge Selection.Value = Left (Temp, Len (Temp) - 1) Else Selection.UnMerge End If Selection.HorizontalAlignment = xlCenter Selection.VerticalAlignment = xlCenter End Sub 

How to combine 2 or more cells in Excel without losing data Picture 4

Step 3: After importing, click File -> Close and Return to Microsoft Excel to return to MS Excel:

How to combine 2 or more cells in Excel without losing data Picture 5

Step 4: So you have created a macro with 2 or more cells without losing data, the rest you create a shortcut combination to use this Macros. Click the Developer tab -> Macros:

How to combine 2 or more cells in Excel without losing data Picture 6

In case the Developer does not appear on the Ribbon, you do the following: Go to the File tab -> Options -> the dialog box appears option Custom Ribbon -> in the Main Tabs area select the Developer -> click OK:

How to combine 2 or more cells in Excel without losing data Picture 7

Step 5: A dialog box appears, the name of the newly created macros is displayed -> click select the name of macros -> select Options to set the shortcut for macros:

How to combine 2 or more cells in Excel without losing data Picture 8

Step 6: Default shortcut key combination Ctrl and 1 any key of your choice, for example, here set Ctrl + e key combination to use macros to combine two or more cells without losing data:

How to combine 2 or more cells in Excel without losing data Picture 9

Step 7: Click the Close icon to close the Macros dialog box :

How to combine 2 or more cells in Excel without losing data Picture 10

Step 8: Finally, select the data range to merge cells and use the shortcut keys instead of the newly created Macros. For example, select cells C1 and C2 -> press Ctrl + e -> 2 cells to be combined into 1 cell without losing data. Special data line breaks:

How to combine 2 or more cells in Excel without losing data Picture 11

Similarly, performing the merging of cells for the remaining exports results:

How to combine 2 or more cells in Excel without losing data Picture 12

The above is a detailed guide on how to combine 2 or more cells in Excel without losing data. Good luck!

4.5 ★ | 2 Vote

May be interested

  • How to merge cells in Excel with no data lossHow to merge cells in Excel with no data loss
    how to merge cells in excel with no data loss normally, you often use merge & center directly to merge cells in excel, but cells with data, you will lose data in the back cells because merge cell only retains data in the first cell.
  • How to split cells, combine cells (cells) in Word tableHow to split cells, combine cells (cells) in Word table
    the following article shows you how to split cells, to merge cells in tables in word 2013.
  • How to cross cells in ExcelHow to cross cells in Excel
    you're making a table in excel and have a blank data cell and you want to cross that box but don't know how to do it. let tipsmake.com help you through the article how to cross cells in excel offline!
  • How to calculate and color blank cells in ExcelHow to calculate and color blank cells in Excel
    counting and coloring blank cells in excel will rely on excel functions and conditions to perform.
  • How to split 1 cell into 2 cells in Excel - Split cells in ExcelHow to split 1 cell into 2 cells in Excel - Split cells in Excel
    how to split 1 cell into 2 cells in excel - split cells in excel. depending on different purposes, you want to split a cell into two cells to enter two different data in one cell and still be able to calculate normally as other cells.
  • How to Alphabetize Cells in ExcelHow to Alphabetize Cells in Excel
    excel is a powerful spreadsheet tool used to store and manage text and numbers, and alphabetizing is one of the many benefits of using excel since it allows you to quickly organize, access, and reference data. to alphabetize cells in excel...
  • How to indent the line in ExcelHow to indent the line in Excel
    when you enter data into a spreadsheet, excel automatically aligns with cells containing numbers to the right of the cell, and text input cells are automatically located to the left of the cell.
  • How to name, comment and protect cells in ExcelHow to name, comment and protect cells in Excel
    instructions on how to name, note and protect cells in excel. 1. name the data cell. - normally, the data cell with the default name is the combination of the column and row order that makes up the cell. for example, cell b5 is named b5. - to change the name for a cell, do as follows: + click to select
  • How to format data based on other cell conditions in ExcelHow to format data based on other cell conditions in Excel
    conditional formatting in excel makes it easier to categorize or highlight data, based on the conditions you set.
  • How to use CONSOLIDATE to statistic, combine data in ExcelHow to use CONSOLIDATE to statistic, combine data in Excel
    consolidate is one of excel's useful data statistics tools. consolidate allows you to quickly perform sum, average, maximum value, minimum value ... how to use consolidate to statistic and pool data in excel