+ Reply to Thread
Results 1 to 2 of 2

VBA Code to Filter and Delete Rows

  1. #1
    Registered User
    Join Date
    02-08-2013
    Location
    Denver, Colorado
    MS-Off Ver
    Excel 2010
    Posts
    12

    VBA Code to Filter and Delete Rows

    I use Excel 2010. I run VBA code on this one table everyday. I currently have to do it partly manually, because it deletes more rows than I want it to.

    My goal is to filter the spreadsheet using this criteria:
    Filter column 22 = "NEP", also filter column 16 = "Groom".
    Then, I wish to delete all rows left (after filtered) that contains "ONSP" or "Offnet" in column G1.
    This last statement doesn't work. Instead, it deletes ALL rows that contain "ONSP" or "Offnet", whether filtered or not.

    Here's my code (I hope it makes sense):

    -------------------------------------------------------
    Please Login or Register  to view this content.
    --------------------------------------------------------
    Thanks,
    Greg
    Last edited by gbloemke; 10-16-2013 at 01:59 PM.

  2. #2
    Forum Contributor
    Join Date
    05-08-2013
    Location
    California
    MS-Off Ver
    Excel 2013
    Posts
    102

    Re: VBA Code to Filter and Delete Rows

    How about this? Will this delete the rows you are hoping to delete (leaving you with the rows you wish to have remaining)?

    Please Login or Register  to view this content.
    I assume you have column headings and that they are in Row 1.
    _____________
    [1] If this reply was helpful, click the star to the left.
    [2] If this reply answered your question, mark this thread as [SOLVED].
    Last edited by Dimitrov; 10-16-2013 at 06:07 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Delete Rows hidden by either Auto Filter and Advanced Filter
    By lesoies in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-05-2013, 10:29 AM
  2. [SOLVED] Filter/Delete Rows
    By ryannjohnsonn in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 10-17-2012, 04:14 PM
  3. Delete rows after filter with VBA
    By cmb80 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-07-2012, 08:54 PM
  4. Delete & Merge Columns,Delete Rows with filter, etc
    By traderindia in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-17-2009, 02:12 AM
  5. Delete Rows After a filter
    By koda86 in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 11-25-2008, 05:02 AM

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