Merge cells without losing data
Loading
Ozgrid Excel Help & Best Practices Forums

Excel Video Tutorials / Excel Dashboards Reports



Results 1 to 4 of 4

Thread: Merge cells without losing data

  1. #1
    Join Date
    19th August 2005
    Location
    Gloucester
    Posts
    2

    Merge cells without losing data

    Hi

    This is a plea for help from a excel novice. I need to merge two columns of cells without losing the data in both.

    e.g column 1 - 123
    column 2 - 456

    I need it to show 123456

    Is there a way of doing this. I have 12647 rows to do this to and dont fancy manually changing these.

    Thanks in advance

    Excel Video Tutorials / Excel Dashboards Reports


  2. #2
    Join Date
    5th May 2005
    Location
    University of Kent!!, UK
    Posts
    988

    Re: Merge cells without losing data

    In Column 3:

    =Column1&Column2

    Or =CONCATENATE(Column1,Column2)

    Hope this helps

    Alastair
    Einstein:
    Things should be made as simple as possible, but not any simpler

    Be sure to check out TemplateZone for all your Microsoft Office Needs.
    Get OfficeReady Professional 3.0 here!

  3. #3
    Join Date
    19th July 2004
    Location
    Tokyo, Japan
    Posts
    6,905

    Re: Merge cells without losing data

    Hi
    VBA solution
    1) hit Alt + F11 to open VB editor
    2) go to Insert -> Module then paste the code there and close the window
    3) in Excel window, go to Tools -> Macro -> Macro and select "test" then hit Run
    The code will merge col.A & B
    VB:
    Sub test() 
        Dim i As Long, a 
        a = Range("a1", Range("a65536").End(xlUp)).Resize(, 2).Value 
        For i = LBound(a, 1) To UBound(a, 1) 
            a(i, 1) = a(i, 1) & a(i, 2) 
        Next 
        With Application 
            .DisplayAlerts = False 
            .ScreenUpdating = False 
            For i = 1 To UBound(a) 
                Cells(i, "a").Resize(, 2).Merge 
            Next 
            Range("a1").Resize(UBound(a, 1)) = a 
            .DisplayAlerts = True 
            .ScreenUpdating = True 
        End With 
    End Sub 
    
    

    Excel Video Tutorials / Excel Dashboards Reports


  4. #4
    Join Date
    19th August 2005
    Location
    Gloucester
    Posts
    2

    Re: Merge cells without losing data

    Thanks All

    It worked a treat. Now i Can drop all my water hydrants onto our OS map in the correct places.

    Thanks again

    Ade

    Excel Video Tutorials / Excel Dashboards Reports


Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Possible Answers

  1. Unmerge And Spread Merge Data To All Cells
    By texan2000 in forum EXCEL HELP
    Replies: 5
    Last Post: April 14th, 2012, 09:06
  2. Merge Cells Without Losing Data
    By Timbo in forum EXCEL HELP
    Replies: 3
    Last Post: August 10th, 2006, 23:49
  3. Pasting a range of cells without losing formatting
    By TroyArthur in forum EXCEL HELP
    Replies: 3
    Last Post: December 11th, 2005, 15:10
  4. merge cells and random colour when data entered
    By HelpMePlease_ie in forum EXCEL HELP
    Replies: 1
    Last Post: March 26th, 2005, 22:09
  5. Merge/connect cells without loss of data?
    By dakar in forum EXCEL HELP
    Replies: 1
    Last Post: October 13th, 2004, 18:48

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •