Removing blank rows

Noir

Active Member
Joined
Mar 24, 2002
Messages
362
My spreadsheet has 2 columns of data. Column A contains part numbers and column B contains serial numbers. I frequently delete part numbers (and serial numbers) due to part discontinuations, etc which leaves many blank rows within my spreadsheet. Removing these rows individually can get time consuming (I sometimes have 40 or 50 rows of data sparatically located throughout my spreadsheet).

How can i remove the blank rows all at once?

Thx,
Noir
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
this works well...........

Sub DeleteEmptyRows()
LastRow = ActiveSheet.UsedRange.Row - 1 + ActiveSheet.UsedRange.Rows.Count
Application.ScreenUpdating = False
For r = LastRow To 1 Step -1
If Application.WorksheetFunction.CountA(Rows(r)) = 0 _
Then Rows(r).Delete
Next r
End Sub
 
Upvote 0
Noir,
someone send me a little add-in that does just what you need.
Give me your e-mail, I'll send it to you
Hans
 
Upvote 0
Hiya,

Seriously I'd go with Nisht and Brian's recommendations- quick and easy. If the original order of the list is needed you could add a column of sequential numbers before sorting - then resort the list by the new column after deleting the rows with no data.

Hope that helps,
Adam
 
Upvote 0

Forum statistics

Threads
1,213,537
Messages
6,114,216
Members
448,554
Latest member
Gleisner2

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