excel macro loop to delete selected rows
Upcoming Power Excel Seminars
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 2 of 2

Thread: excel macro loop to delete selected rows

  1. #1
    New Member
    Join Date
    Mar 2002
    Posts
    1
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

     
    looking for macro to start at this point:
    Rows("13:127").Select
    Selection.Delete Shift:=xlUp

    and loop increasing the range by 10 --ex "23:137" then "33:147" until

    Rows("12013:12127").Select
    Selection.Delete Shift:=xlUp

  2. #2
    MrExcel MVP Al Chara's Avatar
    Join Date
    Feb 2002
    Location
    Newark, Delaware
    Posts
    1,701
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

      
    Try the following code:

    Application.ScreenUpdating = False
    For i = 1 To 1200
    Range(Rows(13 + i * 10), Rows(127 + i * 10)).Delete Shift:=xlUp
    counter = counter + 1
    Next i
    Application.ScreenUpdating = True

    I think this is what you want, but remeber once you delete rows 13:127, row 128 will now be row 13. Is this what you want.
    Best regards,
    Allan Chara
    http://www.mrspreadsheets.com

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

 

 
DMCA.com