Results 1 to 3 of 3

Thread: macro to delete first 5 rows then after every 25

  1. #1
    Seeker sanchit16's Avatar
    Join Date
    Feb 2012
    Location
    New Delhi,India
    Posts
    11
    Articles
    0

    Exclamation macro to delete first 5 rows then after every 25



    Register for a FREE account, and/
    or Log in to avoid these ads!

    hi,

    I need a macro to delete first 5 rows then after every 25 rows again delete 5 rows.


    Hope someone have a clue of it


    thanks in advance!!!

  2. #2
    Off the top

    Code:
    Dim lastrow As Long
    Dim i As Long
    
    
        With ActiveSheet
        
            lastrow = .Cells(.Rows.Count, "A").End(xlUp).Row
            For i = lastrow + (30 - lastrow Mod 30) + 1 To 1 Step -30
            
                .Rows(i).Resize(5).Delete
            Next i
        End With

  3. #3
    Seeker sanchit16's Avatar
    Join Date
    Feb 2012
    Location
    New Delhi,India
    Posts
    11
    Articles
    0
    thanks for your help Bob !!!

Tags for this Thread

Posting Permissions

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