+ Reply to Thread
Results 1 to 3 of 3

Filter, Remove then average left overs

Hybrid View

  1. #1
    Registered User
    Join Date
    10-27-2015
    Location
    CT, USA
    MS-Off Ver
    2010
    Posts
    36

    Talking Filter, Remove then average left overs

    I have been trying to find a way to Filter two Columns.
    First by filtering the "Part number" so that they are grouped, which I believe I have done.
    From there, filter the "Status" by removing anything with an "F", then deleting that row.
    Next remove anything else that does not contain "Pass", "P_TC" and "PTC".
    All that should be left when filtering the "Status" is "Pass", "P_TC" and "PTC".
    And lastly, the averaging of "Zero" and "Span" values for each "Part Number".

    Maybe I am doing it in the wrong order.

    Any help in the right direction will be valued.
    Thank you in advance.
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,651

    Re: Filter, Remove then average left overs

    This will filter the status and delete the rows.

        Dim v As Variant
        
        Application.ScreenUpdating = False
        With ActiveSheet
            If .FilterMode Then .ShowAllData
            .Columns("A:AZ").Hidden = False
            .Columns("A:AZ").AutoFilter Field:=2, Criteria1:=Array("*Pass*", "*P_TC*", "*PTC*"), Operator:=xlFilterValues
            v = .AutoFilter.Range.SpecialCells(xlCellTypeVisible).Value
            .AutoFilterMode = False
            .UsedRange.ClearContents
            .Range("A1").Resize(UBound(v, 1), UBound(v, 2)).Value = v
            .Columns("C:H").Hidden = True
        End With
        Application.ScreenUpdating = True
    I'm not sure where you want to put the part number averages. It would be easy to create a Pivot Table of averages somewhere.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    10-27-2015
    Location
    CT, USA
    MS-Off Ver
    2010
    Posts
    36

    Re: Filter, Remove then average left overs

    I would like to put the average value at the end of the list.
    Perhaps with a "Average" label at the end of "Status", which would lie next to the average values?
    I put a question mark, because i am not sure if such a thing is possible...

+ 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. [SOLVED] How to count cricket overs?
    By tushardnk in forum Excel General
    Replies: 43
    Last Post: 04-20-2024, 07:57 PM
  2. Replies: 5
    Last Post: 12-19-2013, 06:58 AM
  3. Replies: 0
    Last Post: 01-22-2013, 12:22 PM
  4. [SOLVED] Remove left and top bar
    By Mikethk in forum Excel General
    Replies: 3
    Last Post: 05-09-2012, 02:44 AM
  5. Code for mouse-overs?
    By IanWade in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-06-2011, 05:06 AM
  6. Replies: 2
    Last Post: 07-01-2010, 06:34 PM
  7. How Can I Remove Everything to the Left of...
    By Ocean Zhang in forum Excel General
    Replies: 4
    Last Post: 09-21-2009, 10:45 AM

Tags for this Thread

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