Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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" wrote in message ... 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? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 "Christina" wrote in message ... 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? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
how to manually copy text from one cell to end of other text cell | Excel Discussion (Misc queries) | |||
copy selected part number of text from one cell into another cell | Excel Discussion (Misc queries) | |||
Find text in a cell and copy text to another cell | Excel Discussion (Misc queries) | |||
Copy text from cell to cell with one cell changing text | Excel Worksheet Functions | |||
Copy text from text box to cell in another worksheet | Excel Worksheet Functions |