Results 1 to 5 of 5

Skip Section of Code if Filter Returns a Blank

Threaded View

  1. #1
    Registered User
    Join Date
    02-08-2013
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    2

    Skip Section of Code if Filter Returns a Blank

    I have a spreadsheet which will collect a large amount of data throughout the year that I need to report on Monthly. However at present there is very little in there.
    I have written into my macro for it to copy select data remaining from three columns after 3 filters have been applied into another sheet. (the filters contain data from drop down lists so there is no possibility of anyone entering incorrect information.)

    The problem I am having is that if the applied filters return a blank the macro copies and pastes the entire column within the specified datarange. Can anyone assist me in some sort of If/Else statement that will have it do nothing if the filter returns a blank and move onto the next section of code.
    I have included the problem code below.

    Sheets("2013 EOI_Tender").Select
        ActiveSheet.Range("$A$7:$AT$55").AutoFilter Field:=7, Criteria1:="Jan"
        ActiveSheet.Range("$A$7:$AT$55").AutoFilter Field:=4, Criteria1:="Tender"
        ActiveSheet.Range("$A$7:$AT$55").AutoFilter Field:=5, Criteria1:= _
        "Successful"
    
    "This is where it is returning a blank result.  I want it to stop from processing the next bit of code, and move onto another process in the macro"
    
    Sheets("2013 EOI_Tender").Select
        ActiveSheet.Range("C8:C55").Select
        Selection.Copy
        Sheets("Monthly Report").Select
        Range("A9").Select
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
    Last edited by JBeaucaire; 02-08-2013 at 03:31 AM. Reason: Added code tags, as per forum rules. Don't forget!

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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