+ Reply to Thread
Results 1 to 7 of 7

Advance filter automation in VBA

  1. #1
    Registered User
    Join Date
    05-30-2018
    Location
    Northampton
    MS-Off Ver
    Office 2007
    Posts
    2

    Advance filter automation in VBA

    Hi,

    Might be that is super obvious to fix this but I am a proper beginner at VBA hence I need help with this, please.
    I am to set up a log which will be updated daily. There is column "A" for date which will be growing each day and will result in the same date appearing multiple times.
    I need to create a summary on the same sheet based on the dates. So I thought I will use Advance Filter to copy the unique values from column A to column G, then take it from there.
    Works well except that I need to make this automatic every time a new cell in column A is populated with new data. Here I thought VBA will help.

    I put this together with my bf's (Google) help:

    Please Login or Register  to view this content.
    I have no errors on saving/closing the code, so assumed it works. But nope...Can someone help please?

    Thanks
    Eva
    Last edited by alansidman; 05-30-2018 at 08:48 AM.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,940

    Re: Advance filter automation in VBA

    Code Tags Added
    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found at http://www.excelforum.com/forum-rule...rum-rules.html



    (I have added them for you today. Please take a few minutes to read all Forum Rules and comply in the future.)
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,913

    Re: Advance filter automation in VBA

    Copy to range should be single cell (i.e. header), since you are copying single column.

    Try...
    Please Login or Register  to view this content.
    NOTE: Please update your post to nest your code in # code tag.
    ?Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something.?
    ― Robert A. Heinlein

  4. #4
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,909

    Re: Advance filter automation in VBA

    I need to make this automatic every time a new cell in column A is populated with new data
    Take a look at the Worksheet_Change event to automate this.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  5. #5
    Registered User
    Join Date
    05-30-2018
    Location
    Northampton
    MS-Off Ver
    Office 2007
    Posts
    2

    Re: Advance filter automation in VBA

    Thank you, will do! And sorry for not thinking of it before!

  6. #6
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,909

    Re: Advance filter automation in VBA

    No worries, glad to help.

    If you have further questions don't hesitate to ask.

    Thanks for rep+.

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,430

    Re: Advance filter automation in VBA

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

+ 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] Cant filter 2 columns even with advance filter
    By pingpong1 in forum Excel General
    Replies: 19
    Last Post: 07-03-2015, 04:40 PM
  2. advance filter
    By billisnice in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-24-2015, 12:11 AM
  3. Advance filter
    By MURUGANAND in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-19-2014, 10:40 PM
  4. Advance Filter
    By tt388 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 11-28-2008, 07:32 AM
  5. Advance Filter
    By Obi-Wan Kenobi in forum Excel General
    Replies: 3
    Last Post: 03-22-2006, 05:50 PM
  6. Advance filter
    By Obi-Wan Kenobi in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-21-2006, 11:53 AM
  7. Advance filter search does not filter an exact match
    By cfiiland in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-10-2005, 08:05 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