+ Reply to Thread
Results 1 to 5 of 5

Thread: Removing/Adding text to cells

  1. #1
    Registered User
    Join Date
    08-05-2010
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    37

    Question Removing/Adding text to cells

    Hi,

    I have about 700 items that when I try to search and replace the prefix (i.e: cell contains "UPC 070235856985" and I'm trying to remove UPC and the space from the front of the cell so that I can vlookup the number on a different spreadsheet. Both fields are set up as text,) it removes the 0 in front of the number, rendering vlookup useless.

    When trying to record a macro and running it, all it does is replace all cells with the original cell where I recorded the macro.

    Any help would be MAGNIFICENT! Thank you!

  2. #2
    Forum Guru Whizbang's Avatar
    Join Date
    08-05-2009
    Location
    Greenville, NH
    MS-Off Ver
    Excel 2010
    Posts
    1,249

    Re: Removing/Adding text to cells

    You could use a wildcard in your vlookup. That way no matter how it starts, it will find the number you need. No replacement necessary.

    =Vlookup("*YOUR NUMBER",YOURTABLE,1,False)

    Note the *

  3. #3
    Forum Moderator Richard Buttrey's Avatar
    Join Date
    02-15-2008
    Location
    Grappenhall, UK
    MS-Off Ver
    Excel for Windows & Mac - all versions.
    Posts
    6,566

    Re: Removing/Adding text to cells

    Hi,

    Why not just use a helper column and enter
    =RIGHT(A1,LEN(A1)-4)
    copy it down then Copy the helper column and paste it back as values to your original column.

    HTH
    Richard Buttrey

    If this was useful then please rate it appropriately.

    Click the small star icon at the bottom left of my post.

  4. #4
    Forum Contributor meyero90's Avatar
    Join Date
    03-24-2010
    Location
    New York
    MS-Off Ver
    Excel 2007
    Posts
    177

    Re: Removing/Adding text to cells

    try this assuming your word is in A1:
    =RIGHT(TRIM(A1),FIND(" ",TRIM(A1))+8)
    If I helped, Don't forget to add to my reputation (click on the little scale)
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)

  5. #5
    Registered User
    Join Date
    08-05-2010
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    37

    Re: Removing/Adding text to cells

    Quote Originally Posted by Richard Buttrey View Post
    Hi,

    Why not just use a helper column and enter
    =RIGHT(A1,LEN(A1)-4)
    copy it down then Copy the helper column and paste it back as values to your original column.

    HTH
    Absolutely magnificent. Thank you so much!

+ 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.2.0