INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Excel 2007 Concatenate column

Excel 2007 Concatenate column

(OP)
Hello,

I have data in an excel file that I want concatenated from 2 columns.
I have found several examples that work by creating references.

My problem is that I want to delete the source columns after concatenation.

Example
A            B            C
"ABC"    "DEF"        "ABCDEF"

Delete columns A & B.
Column A should now have "ABCDEF"

Thanks.

If at first you don't succeed, then sky diving wasn't meant for you!

RE: Excel 2007 Concatenate column

(OP)
I think I've figured out one way to accomplish this using paste special.

CODE

lngLastRow = Cells(Rows.Count, "A").End(xlUp).Row

Range("C2:C" & lngLastRow).Value = "=A2 & B2"
Columns("C:C").Select
Selection.Copy
Columns("D:D").Select
Selection.pastespecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
     :=False, Transpose:=False
Columns("A:A").Select
Selection.Delete Shift:=xlToLeft
Columns("A:A").Select
Selection.Delete Shift:=xlToLeft
Columns("A:A").Select
Selection.Delete Shift:=xlToLeft 

If at first you don't succeed, then sky diving wasn't meant for you!

RE: Excel 2007 Concatenate column

Hi,

Well you have the formula for concatenation, like =A2&B2.

So after copy/paste down column C...

SELECT Column C

COPY

Right-Click in the selection and select PASTE VALUES.

Proceed to delete columns A & B.

Skip,

glassesJust traded in my OLD subtlety...
for a NUance!tongue

RE: Excel 2007 Concatenate column

(OP)
Thanks for the reply Skip.

If at first you don't succeed, then sky diving wasn't meant for you!

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close