Skip to main content

How to combine contents of multiple cells without losing data in Excel?

We may combine cells and their contents in Microsoft Excel frequently. However, do you find out the easiest way to combine cell contents? Here we will talk about how to combine cell contents in Excel easily and quickly.

Combine multiple cells into one cell with VBA code
Combine multiple cells into one cell with Kutools for Excel without losing data


Combine multiple cells into one cell with VBA code

The following VBA code can help you to combine multiple cells into one cell, and you can apply the code with following steps:

1. Click Developer > Visual Basic, a new Microsoft Visual Basic for applications window will be displayed, click Insert > Module, and input the following code into the Module:

Sub MergeOneCell()
'Updateby20140128
Dim Rng As Range
Dim WorkRng As Range
Dim Sigh As String
On Error Resume Next
xTitleId = "KutoolsforExcel"
Set WorkRng = Application.Selection
Set WorkRng = Application.InputBox("Range", xTitleId, WorkRng.Address, Type:=8)
Sigh = Application.InputBox("Symbol merge", xTitleId, "", Type:=2)
xOut = ""
Application.DisplayAlerts = False
For Each Rng In WorkRng
    xOut = xOut & Rng.Value & Sigh
Next
With WorkRng
    .Merge
    .Value = VBA.Left(xOut, VBA.Len(xOut) - 1)
End With
Application.DisplayAlerts = True
End Sub

2. Then click doc-multiply-calculation-3 button to execute the code. A dialog pops up for you to select a range to work with the VBA. See screenshots:

3. Click Ok, another dialog is displayed for you to specify the seperator. See screenshot:

doc combine cell contents 2

4. Click Ok, then the cell contents in the selected range are combined into a cell. See screenshot:

doc combine cell contents 3


Combine multiple cells into one cell with Kutools for Excel without losing data

If you have Kutools for Excel installed, you can combine cell contents of multiple columns or rows conveniently without using formulas.

1. Select the cells that you want to merge the data. And apply this utility by clicking Kutools > Merge & Split > Combine Rows, Columns or Cells without Losing Data.

2. In the Combine Columns or Rows dialog box, specify the options that you need. See screenshot:

  • (1.) Select Combine into single cell under To combine selected cells according to following options;
  • (2.) Specify a separator for the combined data. You can separated each content with space, nothing, semicolon, or specific text. And you can also display the combined content in a new line.

doc combine cell contents 5

3. Then click OK or Apply, all of the data in multiple cells have been merged into one cell. See screenshot:

Note: This utility can aslo help to combine cells of selected columns. You can combine first and last name into a single full name cell as below screenshot shown.

Then you can see the first names and last names are combined and located in the full name cells.

  If you want to have a free trial (30-day) of this utility, please click to download it, and then go to apply the operation according above steps.


Related Articles


Demo: Combine / Merge multiple cells into one without losing data

Best Office Productivity Tools

🤖 Kutools AI Aide: Revolutionize data analysis based on: Intelligent Execution   |  Generate Code  |  Create Custom Formulas  |  Analyze Data and Generate Charts  |  Invoke Kutools Functions…
Popular Features: Find, Highlight or Identify Duplicates   |  Delete Blank Rows   |  Combine Columns or Cells without Losing Data   |   Round without Formula ...
Super Lookup: Multiple Criteria VLookup    Multiple Value VLookup  |   VLookup Across Multiple Sheets   |   Fuzzy Lookup ....
Advanced Drop-down List: Quickly Create Drop Down List   |  Dependent Drop Down List   |  Multi-select Drop Down List ....
Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  |  Compare Ranges & Columns ...
Featured Features: Grid Focus   |  Design View   |   Big Formula Bar    Workbook & Sheet Manager   |  Resource Library (Auto Text)   |  Date Picker   |  Combine Worksheets   |  Encrypt/Decrypt Cells    Send Emails by List   |  Super Filter   |   Special Filter (filter bold/italic/strikethrough...) ...
Top 15 Toolsets12 Text Tools (Add Text, Remove Characters, ...)   |   50+ Chart Types (Gantt Chart, ...)   |   40+ Practical Formulas (Calculate age based on birthday, ...)   |   19 Insertion Tools (Insert QR Code, Insert Picture from Path, ...)   |   12 Conversion Tools (Numbers to Words, Currency Conversion, ...)   |   7 Merge & Split Tools (Advanced Combine Rows, Split Cells, ...)   |   ... and more

Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time.  Click Here to Get The Feature You Need The Most...

Description


Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!

Comments (7)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
my earlier query is about this vba:Sub MergeOneCell() 'Updateby20140128 Dim Rng As Range Dim WorkRng As Range Dim Sigh As String On Error Resume Next xTitleId = "KutoolsforExcel" Set WorkRng = Application.Selection Set WorkRng = Application.InputBox("Range", xTitleId, WorkRng.Address, Type:=8) Sigh = Application.InputBox("Symbol merge", xTitleId, ",", Type:=2) xOut = "" Application.DisplayAlerts = False For Each Rng In WorkRng xOut = xOut & Rng.Value & Sigh Next With WorkRng .Merge .Value = VBA.Left(xOut, VBA.Len(xOut) - 1) End With Application.DisplayAlerts = True End Sub Between, what does the type here, "8" & "2" refers to
This comment was minimized by the moderator on the site
how repeat the process if i have 4 different reference and need to combine them one after the other
This comment was minimized by the moderator on the site
Awesome! Greatly helps! Thank you so much!
This comment was minimized by the moderator on the site
how to merge 2 cell ex:-[a1:41.00] [B1:kWh] [C1:041.00 kWh]
This comment was minimized by the moderator on the site
Thanks very much - was a big help!
This comment was minimized by the moderator on the site
Thamks a lot for the code. Was very helpful.
This comment was minimized by the moderator on the site
Very helpful thank you took me a while to find it but was just what I needed. Note in the VBA code if you want to seperate data with a semicolon, comma or some other charater in the "delim = " " " field put you charater betwen the quotes example: delim = ";". Thanks again.
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
Rate this post:
0   Characters
Suggested Locations