+ Reply to Thread
Results 1 to 3 of 3

Macros and advanced filter

  1. #1
    Registered User
    Join Date
    10-08-2012
    Location
    ireland
    MS-Off Ver
    Excel 2010
    Posts
    6

    Macros and advanced filter

    I want an automated way of running an advanced filter, when i run the filter it will automatically count how many times the entry was listed.When i run the macro it does not seem to take out duplicates. In particular it duplicates the first entry in the list.

    Currently getting frustrated

    brian
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    12-05-2015
    Location
    Akron, OH
    MS-Off Ver
    15.0
    Posts
    424

    Re: Macros and advanced filter

    Here is my solution. I included an additional worksheet that includes all copied data from "Raw Data" and a button with an additional macro which allows you to dump all the copied data from "Raw Data" back into "Raw Data" in order to debug or prove to yourself that it works. The additional macro saves you from having to copy-and-paste raw data again and again if you want to run the macro multiple times with different scenarios.

    Please Login or Register  to view this content.
    A small improvement may be made to the attached compared to the above code. I forgot to include the following "if" statement in the first two macros but it's in the third. It does display a message saying data is not found, though (MsgBox ("Error: " & DatToFind & " is not found"))... it just looks funny when the cell is empty.

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by joe31623; 02-03-2016 at 02:15 PM.

  3. #3
    Forum Contributor
    Join Date
    12-05-2015
    Location
    Akron, OH
    MS-Off Ver
    15.0
    Posts
    424

    Re: Macros and advanced filter

    As of 1:15 PM EST I fixed another small bug in the above code but not the attached document that only applies to a case where data isn't found. I extended the If-Else statement from right before where the data is written to the end of the sub (else you get an error) for the first subroutine. The other two were already taken care of.

    Forgive the indenting; the correction was done on my phone (so let me know if there are any issues). I'm sure you can easily make the two modifications I described above.
    Last edited by joe31623; 02-03-2016 at 02:20 PM.

+ 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] Advanced Filter Macros - Inconsistant Results
    By TheScott in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-03-2015, 11:04 AM
  2. Advanced Filter : One Criteria Cell Breaks the Filter - Returns Only Headers
    By PaulGW in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-28-2014, 10:06 AM
  3. Replies: 5
    Last Post: 12-19-2013, 06:58 AM
  4. advanced filter - button to re apply advanced filter across multiple sheets
    By motmac87 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-05-2013, 11:16 PM
  5. Second Advanced Filter does not work based on the data generated from the filter
    By mucc1928 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-29-2011, 02:42 PM
  6. Advanced Filter + Several Macros
    By excel_owns_me in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-12-2007, 02:52 AM
  7. [SOLVED] advanced filter a range:Advanced Filter function
    By Il Principe in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 10:05 PM

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