Solved

AutoFilter Delete

Posted on 2014-01-06
2
299 Views
Last Modified: 2014-01-08
I have a dataset that already has some columns filtered (another procedures exit point)  and now need another column filtered and if there is a result (usually is) delete all rows that are greater than zero.

The column is AC, so I need to add to the existing filter, the deleting of all rows greater than zero.  There has been times when there has not been any zeros to filter by, but there has always so far rows greater than zero.

Is this possible, if a filter already in place?  Please advise and thanks. -R-
0
Comment
Question by:RWayneH
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 12

Accepted Solution

by:
Harry Lee earned 500 total points
ID: 39759860
RWayneH,

Are you trying to do this manually or are you trying to do this by VBA?

Either way, you can achieve this easily by first applying all the filters you want, including that Greater than Zero filter.

Then select your whole data range (not including your header rows). Then use F5 (goto) then select Special. In the Special popup window, choose Visible Cells Only, then click ok.

Right click on one of the selected row number and delete rows.

In VBA,

you can do something like this.

    With ActiveSheet
        .AutoFilterMode = False
        With Range("A1:A100000")
            .AutoFilter 1, "="
            On Error Resume Next
            Range("A2:A100000").SpecialCells(12).EntireRow.Delete
        End With
        .AutoFilterMode = False
    End With

Open in new window


In this code example, it will filter range A1 to A100000 for anything equal to blanks. Then select all visible cells within A1 to A100000 and delete the rows.

If you can upload a sample file, I can have the VBA code altered for you.
0
 

Author Closing Comment

by:RWayneH
ID: 39765681
Thanks it worked great!! -R-
0

Featured Post

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question