Need all but one blank row deleted

spatula

New Member
Joined
May 5, 2018
Messages
2
First of all, this is my first post so bare with me. I have been playing around with macros for Excel and have been able to find pretty much everything that I need. The communities are great and appreciate that there are so many willing to helping one another out! Kudos to all!

My situation is that I have to pull reports from some of our documentational software to an excel spreadsheet. The software gives me multiple blank rows (2-3). I do need to be able to separate the groupings as this has to be printed and handed over to another team to work from and do need to have the blank rows. But I only need one blank row. I have had to manually delete the additional blank rows and sometimes it is not a big deal, but other times it is a lot and is something that I need to do repeatedly throughout the day. Can someone help with this situation?

Thanks in advance!
 

Some videos you may like

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.

Peter_SSs

MrExcel MVP, Moderator
Joined
May 28, 2005
Messages
45,090
Office Version
365
Platform
Windows
Welcome to the MrExcel board!

Assuming the blanks can be determined from column A and that there will always be at least one blank in that column, try this on a copy of your data.
Code:
Sub KeppOneBlankRow()
  Dim rA As Range
  
  Application.ScreenUpdating = False
  For Each rA In Columns("A").SpecialCells(xlBlanks).Areas
    If rA.Rows.Count > 1 Then rA.Resize(rA.Rows.Count - 1).EntireRow.Delete
  Next rA
  Application.ScreenUpdating = True
End Sub
 
Last edited:

Watch MrExcel Video

Forum statistics

Threads
1,101,748
Messages
5,482,616
Members
407,354
Latest member
Calvince

This Week's Hot Topics

  • Finding issue in If elseif else with For each Loop
    Finding issue in If elseif else with For each Loop I have tried this below code but i'm getting in Y column filled with W005. Colud you please...
  • MsgBox Error
    Hi Guys, I have the below error show up when i try and run my macro in File1 but works fine if i copy and paste the same code into file2. [ATTACH...
  • CELL FORMAT - IF CONDITION
    My Cell Format is [B]""0.00" Cr". [/B]But in the cell, it is showing 123.00 for editing. (123 is entry figure). (Data imported from other...
  • Show numbers nearly the same
    Is this possible. I have a number that can change very time eg 0.00001234 Then I have a lot of numbers 0.0000001, 0.0000002, 0.00000004...
  • Please i need your help to create formula
    I need a formula in cell B8 to do this >>if b1=1 then multiply ( cell b8) by 10% ,if b1=2 multiply by 20%,if=3 multiply by 30%. Thank you in...
  • Got error while adding column and filter
    Got error while adding column and filter In column Z has some like "Success" and "Error". I want to add column in AA if the Z cell value is...
Top