Concatenating 2 Cells Into 1

  • Hi, my question is I have 1 work book with 2 work sheets. I need the data from 1 cell on the first sheet to be merged with a cell on the second sheet, ( I could also do with this having a line being inserted) can this be done in the same cell or does the merge command only work into a new cell?


    Thanks


    Nick

  • Re: Merging 2 Cells Into 1


    if you work in Excel you can do only in a third cell; using VBA could be done on the same cell


    filippo

  • Re: Merging 2 Cells Into 1


    Can have VBA COde running all the while then......or do I need to apply it to a macro...currently I have this =CONCATENATE("Bussiness Requirement: ",Sheet1!$A$1," ","The preconditions of this test are: ",A1) but it would be great to do this under VBA. I need to do this so this can then be uploaded into another application using an export tool.

  • Re: Merging 2 Cells Into 1


    It's depending on what you are doing.


    Having in Sheet1 B4:"Hallo" and Sheet2 B4: "Nick", a code snippet could be:


    Code
    Sub merge_test()
      With Sheets("Sheet1")
        .Cells(4, "B") = .Cells(4, "B") & " " & Sheets("Sheet2").Cells(4, "B")
      End With
    End Sub


    filippo

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!