+ Reply to Thread
Results 1 to 7 of 7

Adding a prefix to to copied values

  1. #1
    Registered User
    Join Date
    04-23-2013
    Location
    Washington DC
    MS-Off Ver
    Excel 2007
    Posts
    81

    Adding a prefix to to copied values

    I need to modify the below piece of code to:

    1. Select values from rows in Sheet1 where columns C through G sum <> 0
    2. Add the suffix "_xyz" to values in ColA

    I have attached a workbook. The values I need to see are on Sheet2.

    Please Login or Register  to view this content.

    Thank you to this community for helping an Excel newbie.

    MTT

  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,463

    Re: Adding a prefix to to copied values

    I might be missing something but I can't see an attached workbook.

    In the absence of the workbook, this slight amendment is untested:

    Please Login or Register  to view this content.

    Regards, TMS
    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
    Registered User
    Join Date
    04-23-2013
    Location
    Washington DC
    MS-Off Ver
    Excel 2007
    Posts
    81

    Re: Adding a prefix to to copied values

    I neglected to attach it. Here it is. When I ran the code I got a compile error on this line:

    Please Login or Register  to view this content.
    Attached Files Attached Files

  4. #4
    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,463

    Re: Adding a prefix to to copied values

    Delete the asterisks (*) at the beginning and end of the line of code ... I think they must have come from the highlighting.

    Please note that in the Title of the thread, you say "Adding a prefix to to copied values" and in the post itself, you say "Add the suffix "_xyz" to values in ColA"

    I initially edited the code to add a prefix (which is what you have implemented) and then I edited it to add a suffix. Not sure which you want.


    Without the asterisks, it appears to work.

    Regards, TMS

  5. #5
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Adding a prefix to to copied values

    hi MTT, option

    Please Login or Register  to view this content.
    PS. The result you provided has some dicrepancies with your requirements. The code provides result as per requirements sheet.

  6. #6
    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,463

    Re: Adding a prefix to to copied values

    You're welcome. Thanks for the rep.

  7. #7
    Registered User
    Join Date
    04-23-2013
    Location
    Washington DC
    MS-Off Ver
    Excel 2007
    Posts
    81

    Re: Adding a prefix to to copied values

    watersev,

    That is fantastic. Thank you very much!

    MTT

+ 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. copy data inserting a prefix to copied data
    By CPGLH in forum Excel General
    Replies: 2
    Last Post: 02-23-2012, 01:15 AM
  2. adding prefix to numbers
    By dph150 in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 04-08-2011, 02:50 PM
  3. Adding prefix to a name
    By [email protected] in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 06-28-2010, 03:08 AM
  4. adding a prefix to cells
    By PaulPA in forum Excel General
    Replies: 2
    Last Post: 07-17-2006, 03:28 PM
  5. Adding zero prefix to no's
    By Cheryl W in forum Excel General
    Replies: 4
    Last Post: 05-30-2005, 10: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