X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
   Reply to this topicStart new topic
> Autofilter Returns No Results, Office 2007    
post May 18 2017, 02:17 PM

Posts: 478
Joined: 18-October 06

I have googled this question and I see it comes up a lot but I don't know how to apply it to my situation. I have a sheet that I am auto filtering and then copying the visible cells to a new sheet, after some other formatting stuff, it returns to the master sheet ("MySheet") and checks for a new criteria and copies that. What I need to do is that if it checks for the filter criteria and it is not there to not copy/create a new sheet but to go to the next filter criteria. Is this possible?

I tried saying if the visible lines are > 1 go ahead and copy if not GoTo a line label but it did not work. I know GoTo isn't the best answer to begin with but I don't know how else to get it to skip all the copy/paste code (along with a bunch of other stuff I do to the copied data) and find my new filter criteria.

I would appreciate any suggestions.


I'm just a beginner...take pity on me.
Go to the top of the page
post May 18 2017, 03:49 PM

Utter Access VIP
Posts: 5,977
Joined: 22-June 04
From: North Carolina

You can do a countif type function (or read an actual countif form the spreadsheet) to see how many times the condition is met in the data. If zero, don't do it.


One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.
Please zip and attach samples. It makes life easier for those who have to figure out what you are trying to do. Thanks
Go to the top of the page
post May 26 2017, 05:28 PM

Posts: 974
Joined: 8-February 02
From: California, USA

                .Range.AutoFilter Field:=2, Criteria1:="New"
                .Range.AutoFilter Field:=29, Criteria1:="TRUE"
                If WorksheetFunction.Subtotal(3, ActiveSheet.Range("A:A")) > 1 Then
                    .ListColumns(1).DataBodyRange.SpecialCells(xlCellTypeVisible).Copy Destination:=wsRH.Cells(lastRow, 1)
Go to the top of the page

Custom Search
RSSSearch   Top   Lo-Fi    22nd June 2017 - 03:26 PM