+ Reply to Thread
Results 1 to 8 of 8

how to delete unwanted rows at frequent intervals?

  1. #1
    Forum Contributor
    Join Date
    02-28-2012
    Location
    india
    MS-Off Ver
    Excel 2013
    Posts
    542

    how to delete unwanted rows at frequent intervals?

    there are 78 records in a worksheet. if we take a cluster of first six records, i want to retain the first two only . the other four should be deleted. as a result the cells should come upwards. take next six do the same.this should continue till the end. result expected is 26 records only.kindly see the attached file. i have given colored x for the files to be deleted. not to suggest filter and delete. thanks
    Attached Files Attached Files

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: how to delete unwanted rows at frequent intervals?

    Do you want the macro to delete all cells marked x? Or do you want the macro to evaluate the "x" and then delete?

    Also, when rows are deleted, they are deleted from the last row up? So how do you want it to proceed? Delete the last 4 and keep the 1st 2?
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Forum Contributor
    Join Date
    02-28-2012
    Location
    india
    MS-Off Ver
    Excel 2013
    Posts
    542

    Re: how to delete unwanted rows at frequent intervals?

    Quote Originally Posted by arlu1201 View Post
    Do you want the macro to delete all cells marked x? Or do you want the macro to evaluate the "x" and then delete?

    Also, when rows are deleted, they are deleted from the last row up? So how do you want it to proceed? Delete the last 4 and keep the 1st 2?
    thanks for the reply. i want something to delete the four x marked records and to keep the first two records in the first cluster of six records and it should continue to do so. the x mark is for your guidance only. i want a formula to delete every third to sixth records in a cluster of six records.in the end i should get records without x marked. i want a formula to delete those records without a marker like i have done in this example(see the X mark)
    Last edited by sumesh56; 04-22-2013 at 08:36 PM.

  4. #4
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: how to delete unwanted rows at frequent intervals?

    So even if we start deleting rows from the last row moving up, we have to follow the same rule of deleting the last 4 and retaining the top 2, right?

  5. #5
    Forum Contributor
    Join Date
    02-28-2012
    Location
    india
    MS-Off Ver
    Excel 2013
    Posts
    542

    Re: how to delete unwanted rows at frequent intervals?

    Quote Originally Posted by arlu1201 View Post
    So even if we start deleting rows from the last row moving up, we have to follow the same rule of deleting the last 4 and retaining the top 2, right?
    that's right

  6. #6
    Forum Expert JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    The grid, I got in!
    MS-Off Ver
    Excel 2010/13
    Posts
    1,696

    Re: how to delete unwanted rows at frequent intervals?

    Try this,

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Be fore warned, I regularly post drunk. So don't take offence (too much) to what I say.
    I am the real 'Napster'
    The Grid. A digital frontier. I tried to picture clusters of information as they moved through the computer. What did they look like? Ships? motorcycles? Were the circuits like freeways? I kept dreaming of a world I thought I'd never see. And then, one day...

    If you receive help please give thanks. Click the * in the bottom left hand corner.

    snb's VBA Help Files

  7. #7
    Forum Contributor
    Join Date
    02-28-2012
    Location
    india
    MS-Off Ver
    Excel 2013
    Posts
    542

    Re: how to delete unwanted rows at frequent intervals?

    Quote Originally Posted by JapanDave View Post
    Try this,

    Please Login or Register  to view this content.

    thanks for the reply.in your attached file, it says "all macros are disabled for this worksheet". how to enable the macro?

  8. #8
    Forum Expert JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    The grid, I got in!
    MS-Off Ver
    Excel 2010/13
    Posts
    1,696

    Re: how to delete unwanted rows at frequent intervals?

    That is a problem with your computer. You need to go into excel and enable macros in the options.

+ 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