+ Reply to Thread
Results 1 to 5 of 5

How to CONCATENATE when copying cells from source sheet into target sheet

  1. #1
    Registered User
    Join Date
    01-22-2016
    Location
    Canada
    MS-Off Ver
    365
    Posts
    41

    How to CONCATENATE when copying cells from source sheet into target sheet

    I'm an experienced Excel user, but only getting into the VBA side of things. I want to automate some processes in an old spreadsheet to save time and control data entry. However, I'm stumbling on how to add the concatenate function in my VBA code.

    I'm copying data from an old source sheet into a new target sheet via a macro. In the source sheet, cell A1=first name and cell A2=last name; however, in the new target sheet, cell A4=name.

    When running the macro, I receive a "Sub or Function not defined" compile error in the code below:


    wsTarget.Range("A4").Value = wsSource.Range(CONCATENATE(A1, "" - "", A2))


    Any assistance will be appreciated. Thanks.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,425

    Re: How to CONCATENATE when copying cells from source sheet into target sheet

    Please Login or Register  to view this content.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: How to CONCATENATE when copying cells from source sheet into target sheet

    Try this.
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  4. #4
    Registered User
    Join Date
    01-22-2016
    Location
    Canada
    MS-Off Ver
    365
    Posts
    41

    Re: How to CONCATENATE when copying cells from source sheet into target sheet

    Thanks TMS and Norie; both of your suggestions worked.

    I appreciate having two different resolutions as understanding both methods helps to broden my VBA knowledge.

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,425

    Re: How to CONCATENATE when copying cells from source sheet into target sheet

    You're 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. [SOLVED] Copy data from Main sheet to target sheets according to row header and target sheet header
    By realrookie in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-31-2016, 07:26 AM
  2. Target Cell location issue while copying entire sheet by Macro
    By AnimeshRoy in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-04-2016, 12:41 PM
  3. Select range of cells on sheet 2 and concatenate into one cell on sheet one
    By dwachtveitl in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 07-13-2014, 11:59 PM
  4. Copying over cells from one sheet to the next and deleting orginal cell source
    By masond3 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 06-27-2013, 07:54 AM
  5. copying and pasting from source sheet to destination sheet without naming source sht?
    By Simon Lloyd in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-02-2006, 01:15 PM
  6. How to copy a sheet and rename it with the value of two cells from the source sheet?
    By Simon Lloyd in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-11-2006, 08:31 PM
  7. [SOLVED] Copying cells from on sheet to another sheet (via sheet module)
    By CRayF in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-20-2005, 04:05 PM

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