Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 2 of 2

Thread: Multiple Deletion of every second row

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

    Default

    If you have a full spreadsheet with all rows occupied (65,536 rows) is there any quick way of deleting every second row.

  2. #2
    Board Regular
    Join Date
    Mar 2002
    Location
    Milwaukee, WI
    Posts
    105
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hit Alt+F11 to access VBA code. Then choose Insert: Module.

    Type this code

    Sub RemoveEvens()
    Range("A65536").Select
    Do While Not IsEmpty(ActiveCell)
    ActiveCell.EntireRow.delete
    ActiveCell.Offset(-2,0).Select
    Loop
    End Sub

    This will start with the last row and delete every other row assuming there are no blank cells in Column A.

Some videos you may like

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
  •