+ Reply to Thread
Results 1 to 4 of 4

macro to delete every other row thats filtered?

  1. #1
    Registered User
    Join Date
    06-17-2008
    MS-Off Ver
    Excel 2003
    Posts
    30

    macro to delete every other row thats filtered?

    Hi all...

    Can't quite figure out how to do this. I'm looking to create a macro that will delete every other row of a filtered set of data. for example, if these are the filtered rows:

    row 21
    row 22 delete
    row 50
    row 51 delete
    row 58
    row 59 delete.

    ... and so forth down to the bottom of the filter

    I cant seem to record the macro using a relative reference with the filtered data

    Appreciate any assistance...thanks
    Last edited by jasonanthony; 10-03-2008 at 06:27 PM.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259
    Hello jasonanthony,

    This macro will delete alternate rows in a filtered range. The range used in this macro is "A2:A20". You can change this to the range you are filtering. It is marked in red.
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

  3. #3
    Valued Forum Contributor
    Join Date
    06-16-2006
    Location
    Sydney, Australia
    MS-Off Ver
    2013 64bit
    Posts
    1,394
    You need to check if the row you are referencing is hidden or not. Here is some sample code that illustrates the concept. I am sure you can work out what you want to do from here


    Please Login or Register  to view this content.
    Regards

    Matt

  4. #4
    Registered User
    Join Date
    06-17-2008
    MS-Off Ver
    Excel 2003
    Posts
    30
    I can work with this....thanks for the help!

+ 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. Find And Delete Row Macro
    By dtd509 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-18-2009, 05:07 AM
  2. Macro code to find and delete numbers
    By dtd509 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-11-2007, 08:32 PM
  3. A specific Delete Macro
    By dtd509 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-11-2007, 08:37 AM
  4. Need Macro to delete duplicate Values in Column
    By floridagunner in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-19-2007, 11:45 PM
  5. Delete rows using macro
    By newman in forum Excel General
    Replies: 4
    Last Post: 11-03-2006, 03:27 PM

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