+ Reply to Thread
Results 1 to 5 of 5

Concatinating using VBA

  1. #1
    Registered User
    Join Date
    05-24-2017
    Location
    Long Island, NY
    MS-Off Ver
    2010
    Posts
    8

    Post Concatinating using VBA

    Using VBA, I am trying to concatenate 2 columns in one workbook and then apply these concatenated values with a space in between the values in each column to a single column in another workbook. In other words:

    The workbook "ORDERS" has columns J and K that contains first and last names respect. I want to join each J and K with a space separating them into column J of the workbook "TEMPLATE" such that this column J will read "FirstName LastName" for each row until the last.

    Originally I was going to use:

    Please Login or Register  to view this content.
    This produced an error at the firstname assignment.
    Last edited by gshowman1; 06-02-2017 at 11:47 AM.

  2. #2
    Forum Expert
    Join Date
    06-09-2010
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    1,714

    Re: Concatinating using VBA

    hi
    try this
    "J2:J" doesn't work as a range, so I have made the macro create names for each cell in column J including and after J2 than is not blank

    Please Login or Register  to view this content.

  3. #3
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: Concatinating using VBA

    .

    Here is one method of many possibilities ...

    Paste this into a Routine Module :

    Please Login or Register  to view this content.
    You'll need to edit the sheet names, etc.

  4. #4
    Registered User
    Join Date
    05-24-2017
    Location
    Long Island, NY
    MS-Off Ver
    2010
    Posts
    8

    Re: Concatinating using VBA

    Thank you NickyC & Logit!

  5. #5
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: Concatinating using VBA

    You are welcome

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. joining or concatinating 2 fields
    By mrIslic in forum Excel General
    Replies: 2
    Last Post: 05-11-2015, 07:02 PM
  2. concatinating based on product id
    By anilg0001 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-04-2014, 01:24 AM
  3. Concatinating with if statements
    By Anzibanonzi in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-21-2014, 12:14 PM
  4. Concatinating row values with a coma
    By Ahazin01 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-09-2013, 09:38 AM
  5. Concatinating inside MATCH
    By ChemistB in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-29-2007, 11:22 AM
  6. Concatinating a string of numbers - how?
    By drod in forum Excel General
    Replies: 5
    Last Post: 08-02-2006, 05:10 PM
  7. Concatinating cells
    By Praveen in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-11-2005, 05:05 AM

Tags for this Thread

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