+ Reply to Thread
Results 1 to 3 of 3

Advanced Auto Filter. ( Get Distinct Value, Max, Min )

  1. #1
    Registered User
    Join Date
    04-08-2014
    Location
    Philippines
    MS-Off Ver
    Excel 2007
    Posts
    4

    Advanced Auto Filter. ( Get Distinct Value, Max, Min )

    Hi everyone,

    I am new in macro and vba. I am having a problem in getting the data in my RawData. I want to get the max and min value, distinct value, and number of total records of each element. It ranges from (D:T) in RawData Sheet and to be extract in Sheet2. I have attach my file that i made and put some details. I also put Sheet3 which is the sample result of my work it is filled with color red on the tab.

    I will be glad to have your suggestions or if there is revisions to be made.

    Thanks.
    Attached Files Attached Files

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Advanced Auto Filter. ( Get Distinct Value, Max, Min )

    Hello slapaks,

    Welcome to the Forum!

    After downloading the workbook and running the macro, it appears to filter and copy data as you intended.

    What min and max values are you referring to? Which columns on the Sheet2 would the copied to?
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    04-08-2014
    Location
    Philippines
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Advanced Auto Filter. ( Get Distinct Value, Max, Min )

    Hi Ross

    In my macro in commandbutton it will filter RawData column(B) and will filter the first element the ones filled with color yellow in RawData. I want to filter it starting in Column(D) to column(T) and so on if there will be added elements. Then after RawData column(B) will be filter to a certain criteria e.g(Primary) and the first element will be filtered column(D) after column (D) is filtered by
    unchecking the blanks, then it will do the following:

    First copy the LabCode(RawData!C) unique values only maximum of two will be copy. It will be copied to Sheet2!F5:G5, if only 1 labcode put in F5, G5 will be left blank
    Then it will get the number with greater than> or less than< sign it will be put in Sheet2(H5:J5) maximum of three det. limit if blank it will ignore or left as blank.
    Then it will get the maximum and min number in the filtered element RawData columnD. Max no. will be copied to Sheet2!K5 and min no. will be copied to L5.
    Then it will get the total number of records when everything is unfiltered. and get the number of records of the elements when RawData!B is filtered and RawData!D is filtered.

    I will attach a follow up sample. Thank you for your time. and please tell me if i need some revision.
    Attached Files Attached Files

+ 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. Delete Rows hidden by either Auto Filter and Advanced Filter
    By lesoies in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-05-2013, 10:29 AM
  2. [SOLVED] Advanced Filter results don't match auto filter
    By WaterWings in forum Excel General
    Replies: 1
    Last Post: 09-13-2012, 05:37 PM
  3. Using advanced auto filter to choose all of range
    By mendozati in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-23-2011, 01:26 AM
  4. how write to rows selected by auto/advanced filter in VBA code
    By xdalibor in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-07-2011, 11:28 AM
  5. Auto Update for Advanced Filter & Sort Data
    By limjian85 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-24-2005, 08:02 AM

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