+ Reply to Thread
Results 1 to 2 of 2

Excel 2007 : Remove every row based on value in column

Hybrid View

  1. #1
    Registered User
    Join Date
    05-17-2012
    Location
    Dallas
    MS-Off Ver
    Excel 2007
    Posts
    2

    Remove every row based on value in column

    I need to remove every row that has a "0" in a specific column. What i have it 16463 products and some of the products have a 0 value for quanity and i need to remove them so that they do not import into my site. So i need a macro i can run that will purge the spreadsheet of all products /rows that have a 0 value in the quantity column.

    As i said there are 16,436 rows and AA is the column which has the quantity value. To run something that will go to each row find the AA column and if it has a 0 in it delete the entire row. Thank you for your help


    Tony
    Website Designer
    Team Web USA

  2. #2
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,327

    Re: Remove every row based on value in column

    Try

    Please test on a copy of your data first

    Sub DelRows2()
        Application.ScreenUpdating = False
        With Sheets("Sheet1").Range("AA1", Range("AA" & Rows.Count).End(xlUp))
            .AutoFilter Field:=1, Criteria1:=0
            .Offset(1).EntireRow.Delete
            .AutoFilter
        End With
        Application.ScreenUpdating = True
    End Sub
    HTH
    Regards, Jeff

+ Reply to Thread

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