+ Reply to Thread
Results 1 to 9 of 9

find and replace - based on 3 character in adjacent cell

  1. #1
    Registered User
    Join Date
    08-02-2010
    Location
    Kuala Lumpur, Malaysia
    MS-Off Ver
    Excel 2007
    Posts
    55

    Smile find and replace - based on 3 character in adjacent cell

    Hello everyone!

    I would like to replace CODE to Product Name based on criteria in INVOICE NO.
    The criteria is:
    1. If INVOICE NO begin with "A", it will identify the 3rd, 4th & 5th character and
    match with the product name. Then, replace code to product name in the right cell.
    2. If INVOICE NO not begin with "A", it will identify the 2nd, 3rd & 4th character and
    match with the product name. Then, replace code to product name in the right cell.

    For example:

    x101xxxxx - Apple (Change/insert 20805002 to Apple)
    Ax101xxxxx - Apple (Change/insert 20805002 to Apple)

    x102xxxxx - Orange (Change/insert 20805002 to Orange)

    x409xxxxx - Grape (Change/insert 20005008 to Grape)
    Ax409xxxxx - Grape (Change/insert 20005008 to Grape)

    See attachment for better understanding.
    Your help are highly appreciate!
    Thanks!
    Attached Files Attached Files
    Last edited by isabella; 08-24-2010 at 08:50 PM.

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: find and replace - based on 3 character in adjacent cell

    Hi

    Put the following values in the range I7:J9
    101,Apple
    102,Orange
    409,Grape

    Give that range a defined name of LURng.

    Please Login or Register  to view this content.
    HTH

    rylo

  3. #3
    Registered User
    Join Date
    08-02-2010
    Location
    Kuala Lumpur, Malaysia
    MS-Off Ver
    Excel 2007
    Posts
    55

    Smile Re: find and replace - based on 3 character in adjacent cell

    Nicely work. Thanks!

    But, how can I do if I want to put the range on other worksheet?
    Last edited by isabella; 08-23-2010 at 11:04 PM.

  4. #4
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: find and replace - based on 3 character in adjacent cell

    Hi

    Which range? The lookup? The output?

    rylo

  5. #5
    Registered User
    Join Date
    08-02-2010
    Location
    Kuala Lumpur, Malaysia
    MS-Off Ver
    Excel 2007
    Posts
    55

    Re: find and replace - based on 3 character in adjacent cell

    Sory,

    I mean the LURng. I've tried to put it in other worksheet, but there is error. What changes that I need to make in the code?

    Thanks.

  6. #6
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: find and replace - based on 3 character in adjacent cell

    Hi

    Fully qualify the name. So if you put it on sheet2, then try
    Please Login or Register  to view this content.
    rylo

  7. #7
    Registered User
    Join Date
    08-02-2010
    Location
    Kuala Lumpur, Malaysia
    MS-Off Ver
    Excel 2007
    Posts
    55

    Re: find and replace - based on 3 character in adjacent cell

    Got it! Thanks rylo!

  8. #8
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: find and replace - based on 3 character in adjacent cell

    If that takes care of your need, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  9. #9
    Registered User
    Join Date
    08-02-2010
    Location
    Kuala Lumpur, Malaysia
    MS-Off Ver
    Excel 2007
    Posts
    55

    Re: find and replace - based on 3 character in adjacent cell

    Thank you for remind me..

+ 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.6.0 RC 1