DELETING BLANK ROWS OR ROWS W/ A SPECIFIC WORD

ESCIV

New Member
Joined
Sep 25, 2002
Messages
11
I have exported data from Quickbooks into Excel which I need to print. Unfortunately the QB report includes a blank line after each record. It also has 2 lines with the word "total" which I don't want. If I can delete the blank rows and each row that contains the "total" I can reduce the report from 300 pages to about 20! But how to?
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
My, slightly obscure, method is to inster a column, put a one next to the first row (the one with data) and leave the next blank, then a two. I then select the top four cells and autofill down to the bottom, I then sort the entire sheet on this column so that the blank cells get moved to the bottom.
Same goes for getting rid of the "total" rows...just make sure they don't have a number asigned.

Its not pretty but its quicker than "delete row" "delete row" etc etc all day long.
 
Upvote 0
Here's a macro that will do that, without loops or an extra column. It assumes your "total" word, and blank cells, are in column A (if not, then modify the code for the appropriate column):

Sub DeleteRowsTotal()
Range("A:A").Replace What:="total", Replacement:="", LookAt:=xlWhole
On Error Resume Next
Range("A:A").SpecialCells(xlBlanks).EntireRow.Delete
End Sub
 
Upvote 0

Forum statistics

Threads
1,213,524
Messages
6,114,117
Members
448,549
Latest member
brianhfield

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top