+ Reply to Thread
Results 1 to 12 of 12

Replace value with another

  1. #1
    Forum Contributor
    Join Date
    02-06-2014
    Location
    The Show Me State
    MS-Off Ver
    Excel 2013
    Posts
    343

    Replace value with another

    I am trying to replace a cell value in column F with another value from my worksheet. There are too many to use find and replace. Is there a way to use Vlookup to do this. I attached my original with a worksheet tab and a expected outcome tab. The full file has almost 5k rows. Another issue I have is some of the replacement values are like 44E8. The 'E' transfers over as scientific notation. I did try the code below but that didn't work due to 44E8 type values. (I borrowed this code from youtube)

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by gz3s36; 07-14-2020 at 12:50 PM. Reason: Added info

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,872

    Re: Replace value with another

    Give this a try:

    Please Login or Register  to view this content.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Contributor
    Join Date
    02-06-2014
    Location
    The Show Me State
    MS-Off Ver
    Excel 2013
    Posts
    343

    Re: Replace value with another

    The only issue is the 2.70E+02 type results due to the 27E8 value.

  4. #4
    Forum Contributor
    Join Date
    02-06-2014
    Location
    The Show Me State
    MS-Off Ver
    Excel 2013
    Posts
    343

    Re: Replace value with another

    Alansidman...Also some cells turned red for some reason but I don't have any conditional formatting.

  5. #5
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,872

    Re: Replace value with another

    The code turns cells red if they do not find a solution in the Vlookup. Similar to getting an #n/a when you are doing a formula based vlookup. Lets you know it didn't find an answer.

    Cannot replicate your issue of Scientific notation with the sample your provided. Is your actual data different from your sample?
    Last edited by alansidman; 07-14-2020 at 02:47 PM.

  6. #6
    Forum Contributor
    Join Date
    02-06-2014
    Location
    The Show Me State
    MS-Off Ver
    Excel 2013
    Posts
    343

    Re: Replace value with another

    Getting ready to leave for the day. I'll upload a file where the Scientific notations occur tomorrow. The smaller file didn't have those values. Thanks.

    Just a quick note. It appears to have pulled all correct data but ALL cells are red.
    Last edited by gz3s36; 07-14-2020 at 02:54 PM. Reason: Added info

  7. #7
    Forum Contributor
    Join Date
    02-06-2014
    Location
    The Show Me State
    MS-Off Ver
    Excel 2013
    Posts
    343

    Re: Replace value with another

    Here is the file where the vlookup code works well except for any text with 'E' in it. If 'E' is present it returns scientific notation.
    Attached Files Attached Files

  8. #8
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,872

    Re: Replace value with another

    I don't have a solution for you. I will ask others to try and solve.

  9. #9
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,907

    Re: Replace value with another

    Try adding:

    Please Login or Register  to view this content.
    before the loop.
    Rory

  10. #10
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,075

    Re: Replace value with another

    How about this mod to Alan's code
    Please Login or Register  to view this content.

  11. #11
    Forum Contributor
    Join Date
    02-06-2014
    Location
    The Show Me State
    MS-Off Ver
    Excel 2013
    Posts
    343

    Re: Replace value with another

    Fluff13...Just got to try your solution. Worked great. Thanks a bunch.

  12. #12
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,075

    Re: Replace value with another

    You're welcome & thanks for the feedback.

+ 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. Macro: Search and replace: Replace using a cell reference
    By kalyan46 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-11-2019, 07:11 PM
  2. Replies: 1
    Last Post: 02-27-2018, 11:22 AM
  3. REPLACE function help replace two separate texts Ctrl H
    By Uldis in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-23-2015, 10:51 AM
  4. [SOLVED] find and replace to not replace characters found as wildcards
    By sabutler4 in forum Excel General
    Replies: 4
    Last Post: 07-03-2013, 06:48 PM
  5. Multiple Find and Replace to replace a list of strings
    By WalterP34 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-11-2011, 07:41 PM
  6. Replace Function:Replace" and type in
    By ronnyc in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-19-2007, 06:26 PM
  7. [SOLVED] find and replace - replace data in rows to separated by commas
    By msdker in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-14-2006, 08:10 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