+ Reply to Thread
Results 1 to 4 of 4

Concatenate 2 colums where there is data

Hybrid View

  1. #1
    Registered User
    Join Date
    06-17-2011
    Location
    Boston, MA
    MS-Off Ver
    Excel 2007
    Posts
    52

    Smile Concatenate 2 colums where there is data

    Hello All,
    I am looking for a macro to concatenate K% and L% into M% for every row which column K has data.

    I have attached a spreadsheet to serve as an example. Column M represents the final output.

    Thanks in advance!
    Attached Files Attached Files
    Last edited by tiger10012; 10-12-2011 at 11:24 AM.

  2. #2
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Concatenate 2 colums where there is data

    With the information you have provided
    In M2
    =(K1*10)+L1
    Drag/Fill Down.
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

  3. #3
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,454

    Re: Concatenate 2 colums where there is data

    But if you must do it with code..

    Sub a()
    Dim rCell As Range
    For Each rCell In Range(Range("K1"), Range("K" & Rows.Count).End(xlUp))
    If rCell.Value <> "" Then rCell.Offset(0, 2).Value = rCell.Value & rCell.Offset(0, 1).Value
    Next
    End Sub
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

  4. #4
    Registered User
    Join Date
    06-17-2011
    Location
    Boston, MA
    MS-Off Ver
    Excel 2007
    Posts
    52

    Re: Concatenate 2 colums where there is data

    Thanks so much to both of you. This is great.

    sweep...thanks for following up with the code. This is something I have been dying to incorporate into my other existing macros for quite some time.

    Cheers!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1