Copy text from one cell to another

  • Thread starter Thread starter Christina
  • Start date Start date
C

Christina

I have two collums of cells with text in each row. I want
to copy the text from one collum into the other, but not
overriding the original text. For example:

One collum has sations: 10+00
The other has LT or RT: LT
I want the final product to be: 10+00 LT
all in the same cell. I would like to be able to do this
in one command for all the rows in the sheet.

I'm not even sure where to start. Any suggestions?
 
This should work.

Sub Concatenate()
'Set up
Dim colFirst As Integer
Dim colSecond As Integer
Dim rowLast As Integer
Dim rowFirst As Integer
Dim i As Integer

'Assume data located in columns A,B rows 5 to 25
colFirst = 1
colSecond = 2
rowFirst = 5
rowLast = 25

For i = rowFirst To rowLast
'Set 2nd column = 1st column + 2nd column
Cells(i, colSecond) = Cells(i, colFirst).Value & " " & Cells(i,
colSecond).Value
Next i

End Sub
 
Christina,

Assuming that you are using columns A & B and assuming
that I am understanding your question.

Sub FixMyCells()

Dim x as long

For x = 1 to Cells(Rows.COUNT, "A").End(xlUp).Row
cells(x,2) = cells(x,1) & cells(x,2)
Next

End Sub

Add & " " between the cells if you want a space.
cells(x,2) = cells(x,1) & " " & cells(x,2)
You might want to change each of the cells() statements to
cells().Text

steve
 
Back
Top