+ Reply to Thread
Results 1 to 3 of 3

End sub if filter FALSE

  1. #1
    Forum Contributor
    Join Date
    12-30-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    103

    End sub if filter FALSE

    Hi All,

    I need my macro to stop running and display a message box if the filter return is false. How can this code to added to or amended to make this happen?

    Columns("A:B").Select
    Range("B1").Activate
    Selection.AutoFilter
    ActiveSheet.Range("$A$1:$B$2000").AutoFilter Field:=2, Criteria1:="1000"

    Thanks

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

    Re: End sub if filter FALSE

    Please use Code Tags when posting code. TY
    How about this ?

    Please Login or Register  to view this content.
    Last edited by bakerman2; 11-07-2017 at 01:04 AM.
    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.

  3. #3
    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,872

    Re: End sub if filter FALSE

    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.

    Click on Edit to open your thread, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)
    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

+ 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] With same contract number, any cell in B False, then All cells false in C,
    By rajeshn_in in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-21-2017, 10:42 PM
  2. Pivot Filter Items = false if sum would be 0
    By FixandFoxi in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-26-2017, 05:22 PM
  3. [SOLVED] All in one line of code: ScreenUpdating=False, Calculation=Manua, DisplayAlerts=False
    By luv2glyd in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-13-2016, 03:10 PM
  4. Replies: 1
    Last Post: 09-30-2013, 10:56 PM
  5. Auto filter based on true / false criteria
    By Rossce in forum Excel General
    Replies: 4
    Last Post: 04-27-2012, 10:44 AM
  6. Pivot Table - false filter display
    By atobdavis in forum Excel General
    Replies: 2
    Last Post: 06-11-2010, 09:03 AM
  7. Adv Filter criteria, true false, vs 1 and 0
    By Larryr8732 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-31-2007, 12:02 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