Adding Two Text Cells

S

Sam

Hi,

Is there an easy way to concatenate two cells??

Suppose the worksheet has six cells like this:

Row 1: John Smith
Row 2: Dick Jones
Row 3: Property Acme

Rows one and two are the way they should be, but row three should read `Acme
Property' in the right hand cell, while the left hand cell should be empty.

Is there a way to automate this process on a large worksheet without
retyping all the data??

Thanks,

Sam
 
T

Tim Williams

If automating the process how to tell which rows should be adjusted and
which left alone?

If you can select all of the problem rows together then

'***********************************
dim rw, r
for each rw in selection.rows
r=rw.row
with activesheet
.cells(r,2).value=.cells(r,2).value & " " & _
.cells(r,1).value
.cells(r,1).clearcontents
end with
next rw
'************************************


Tim
 
M

ME @ Home

Sam said:
Hi,

Is there an easy way to concatenate two cells??

Suppose the worksheet has six cells like this:

Row 1: John Smith
Row 2: Dick Jones
Row 3: Property Acme

Rows one and two are the way they should be, but row three should read `Acme
Property' in the right hand cell, while the left hand cell should be empty.

Is there a way to automate this process on a large worksheet without
retyping all the data??

Thanks,

Sam

or if you do not want to use a macro the & symbol will join 2 or more cells

Row 1: John Smith
Row 2: Dick Jones
Row 3: Property Acme
row 4 :=b3 & " " & a3
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top