Results 1 to 3 of 3

Replace Filtered Value

Threaded View

  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.

    Sub demo()
         
        With ActiveSheet
            Set rnData = .UsedRange
            With rnData
                .AutoFilter Field:=1, Criteria1:="A"
                .Select
                For Each rngarea In .SpecialCells(xlCellTypeVisible).Areas
                    lcount = lcount + rngarea.Rows.Count
                
                
                Next
                lcount2 = lcount - 1
                  
                <<don't know whats next>>
            
            End With
        End With
         
    End Sub
    Thank you so much.
    Last edited by arlu1201; 05-26-2013 at 06:30 AM. Reason: Use code tags in future.

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