+ Reply to Thread
Results 1 to 3 of 3

Replace Filtered Value

  1. #1
    Registered User
    Join Date
    05-26-2013
    Location
    manila
    MS-Off Ver
    Excel 2007
    Posts
    2

    Replace Filtered Value

    Hi,

    I need to seek assistance in regard to AutoFilter.

    First, I need to filter Code "A", "B", "C". If code "A" is filtered and my row = 3 I will replace

    the value into COFFEE, TEE, CHOCOLATE. And if code "B" is filtered and my row=2 then I will replace

    the value into COFFEE, TEE and lastly if code "C" filtered and my row =1 I will replace the value

    into COFFEE.

    Scenario:

    Code Value CRITERIA
    A 10 COFFEE
    B 20 TEA
    C 30 CHOCOLATE
    A 40
    B 50
    A 60

    OUTPUT:
    Code Value
    A COFFEE
    B TEA
    C CHOCOLATE
    A COFFEE
    B TEA
    A COFFEE


    I started my code with this but I was stacked in here. I Hope someone will help me with my code.

    Please Login or Register  to view this content.
    Thank you so much.
    Last edited by arlu1201; 05-26-2013 at 06:30 AM. Reason: Use code tags in future.

  2. #2
    Forum Expert JasperD's Avatar
    Join Date
    05-07-2013
    Location
    Netherlands
    MS-Off Ver
    Excel 2016
    Posts
    1,393

    Re: Replace Filtered Value

    So basically, if the cell in column A says "A" then you want the cell in column C to say "COFFEE", when the cell in column A says "B", you want the cell in column C saying "TEA" etc ?

    Why not just like this :

    Please Login or Register  to view this content.
    Please click the * below if this helps

  3. #3
    Registered User
    Join Date
    05-26-2013
    Location
    manila
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Replace Filtered Value

    Hi thank you so much for your quick reply.

    I think my output was misleading. My output should look like this:

    If A was filtered:
    OUTPUT:
    Code Value
    A COFFEE
    A TEA
    A CHOCOLATE

    If B was filtered:
    OUTPUT:
    Code Value
    B COFFEE
    B TEA


    If C was filtered
    OUTPUT:
    Code Value
    C COFFEE

    If you notice If no. of rows is 3 then then output should be COFFEE,TEA,CHOCOLATE
    If no. of rows is 2 then output should be COFFEE,TEA
    If no. of rows is 1 then output should be COFFEE

    The maximum of rows is only three.

    I hope you can help me. Again thank you

+ 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