Deleting multiple rows in Excel

natasha_tracy

New Member
Joined
Aug 20, 2007
Messages
49
Hello All,

I have searched the forum already for this problem, but as far as I can see none of the threads related are quite what I'm looking for.

I have a spreadsheet with thousands of rows of data- some rows throughout the sheet are completely blank. Is there a way I can select all the blank rows and delete them without going through and selecting each row? I have tried sorting the data so that all the blank rows go to the end, but I need the data to stay in the order I imported it in, which cannot be sorted back in excel.

If anyone can help - it would be much appreciated.

Natasha
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.

ADAMC

Well-known Member
Joined
Mar 20, 2007
Messages
1,169
Office Version
  1. 2013
Platform
  1. Windows
edit

Hi welcome to the board,

Try selecting your column which contains data and running this code placed in the sheet module

Code:
Sub DeleteRowOnCell()
On Error Resume Next
Selection.SpecialCells(xlCellTypeBlanks).EntireRow.Delete
ActiveSheet.UsedRange
End Sub
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,163,785
Messages
5,833,693
Members
430,224
Latest member
Tirrazo

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
Top