Results 1 to 5 of 5

Thread: How to remove every other row in a spreadsheet from report quickly
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    Board Regular
    Join Date
    Aug 2008
    Posts
    57
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default How to remove every other row in a spreadsheet from report quickly

    Can anyone provide me with a quick way to remove every other row in a spreadsheet report?

  2. #2
    MrExcel MVP
    Moderator
    Fluff's Avatar
    Join Date
    Jun 2014
    Location
    Chippenham
    Posts
    28,190
    Post Thanks / Like
    Mentioned
    470 Post(s)
    Tagged
    47 Thread(s)

    Default Re: How to remove every other row in a spreadsheet from report quickly

    Maybe
    Code:
    Sub nolanstern()
       With Range("A2", Range("A" & Rows.Count).End(xlUp))
          .Value = Evaluate("if(mod(row(" & .Address & "),2)=0,true," & .Address & ")")
          .SpecialCells(xlConstants, xlLogical).EntireRow.Delete
       End With
    End Sub
    How many rows do you have in the report?
    - Posting Data try one of these tools
    - Posting guidelines, forum rules and terms of use
    - Read the FAQs

    Running Office 365 on Win 10

  3. #3
    MrExcel MVP
    Junior Admin
    Joe4's Avatar
    Join Date
    Aug 2002
    Posts
    50,794
    Post Thanks / Like
    Mentioned
    57 Post(s)
    Tagged
    11 Thread(s)

    Default Re: How to remove every other row in a spreadsheet from report quickly

    What does the data look like?
    Is there anything consistent about this rows that you want to remove (i.e. are they all blank)?
    Is it the odd or even number rows that you want to delete?
    TIPS FOR FINDING EXCEL SOLUTIONS
    1. Use the built-in Help that comes with Excel/Access
    2. Use the Search functionality on this board
    3. A lot of VBA code can be acquired by using the Macro Recorder.

    "Give a man a fish, feed him for a day. Teach a man to fish, feed him for life!"

  4. #4
    Board Regular
    Join Date
    Aug 2008
    Posts
    57
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: How to remove every other row in a spreadsheet from report quickly

    The number of rows varies from day to day.

  5. #5
    MrExcel MVP
    Moderator
    Fluff's Avatar
    Join Date
    Jun 2014
    Location
    Chippenham
    Posts
    28,190
    Post Thanks / Like
    Mentioned
    470 Post(s)
    Tagged
    47 Thread(s)

    Default Re: How to remove every other row in a spreadsheet from report quickly

    Approximately how many rows?
    And can you answer Joe's questions as well
    - Posting Data try one of these tools
    - Posting guidelines, forum rules and terms of use
    - Read the FAQs

    Running Office 365 on Win 10

Some videos you may like

User Tag List

Tags for this Thread

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
  •