+ Reply to Thread
Results 1 to 4 of 4

What if criteria doesn't exist for autofilter?

  1. #1
    Registered User
    Join Date
    02-04-2011
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    3

    What if criteria doesn't exist for autofilter?

    I've built a macro that takes a downloaded spreadsheet and filters the infomation based on set criteria and then copies it to a specified tab. One of the criterias though, doesn't always appear. My macro gives an error when it gets to this line when the criteria is missing. How can I make it "overlook" the autofilter if the criteria isn't there? Below is my code. So in this example, if "IO" doesn't exist how can I make it skip these lines of code?


    Please Login or Register  to view this content.
    Last edited by brandoncurrey; 02-04-2011 at 05:31 PM.

  2. #2
    Forum Guru
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2003
    Posts
    4,168

    Re: What if criteria doesn't exist for autofilter?

    put this be4 autofilter, it should help

    Please Login or Register  to view this content.
    this will help to avoid "skip" autofilter error but will proceed with the other code lines
    Last edited by watersev; 02-04-2011 at 04:17 PM.

  3. #3
    Forum Guru
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2003
    Posts
    4,168

    Re: What if criteria doesn't exist for autofilter?

    if you want to skip everything after the autofilter line:
    Please Login or Register  to view this content.
    Last edited by watersev; 02-04-2011 at 04:22 PM.

  4. #4
    Registered User
    Join Date
    02-04-2011
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: What if criteria doesn't exist for autofilter?

    That's it????!!!!!

    Perfect, it works great. Appreciate your help!!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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