+ Reply to Thread
Results 1 to 5 of 5

Conditional Deleting of rows based on how many and how much?

  1. #1
    Registered User
    Join Date
    01-22-2012
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    75

    Talking Conditional Deleting of rows based on how many and how much?

    Hi Guys,

    Can someone write me a script that can delete specified # of rows after # of rows specified?

    for example: Delete 2 rows after every 38 rows.

    Thanks in advance!

  2. #2
    Forum Contributor
    Join Date
    04-11-2011
    Location
    Columbus, Ohio
    MS-Off Ver
    Excel 2007
    Posts
    325

    Re: Conditional Deleting of rows based on how many and how much?

    Do the rows that you are deleting have something in them that distinguishes them from other rows? If yes, there is a better way to do what you are asking.

    Please Login or Register  to view this content.
    The above should do what you ask but there are better ways to delete variable rows.

  3. #3
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,887

    Re: Conditional Deleting of rows based on how many and how much?

    Hi Rabbit,

    I think you would need to call 111's code from another macro, passing it the a and b values. If you were just looking to run a macro to delete every 39th/40th rows (assuming starting in row 1), you could use:
    Please Login or Register  to view this content.
    This will delete rows 199 & 200, 159 & 160, 119 & 120, 79 & 80, 39 & 40.

  4. #4
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Conditional Deleting of rows based on how many and how much?

    Hi Rabbitstew,

    You could try something like this:

    Please Login or Register  to view this content.
    XLAdept
    Last edited by xladept; 04-24-2012 at 08:13 PM. Reason: Afterthought

  5. #5
    Registered User
    Join Date
    01-22-2012
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    75

    Re: Conditional Deleting of rows based on how many and how much?

    Awesome! thanks everyone!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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