removing empty rows

  • Thread starter Thread starter Brian
  • Start date Start date
B

Brian

I've imported data into excel. Only every 10th or so row
has data - the rest of the rows are empty. Is there an
easy way to remove the all empty rows withoyt having to
select and delete each one (or group) individually? I've
got about 2000 rows and only about 200 with data.
 
One way

select the imported range, press F5 and click special, select blanks,
press ctrl and - (minus/dash), select entire row and click OK
 
Worked like a charm Thanks!
-----Original Message-----
One way

select the imported range, press F5 and click special, select blanks,
press ctrl and - (minus/dash), select entire row and click OK

--

Regards,

Peo Sjoblom





.
 
Ensure that your data has headers. Click Data --> Filter -
-> Autofilter. Drop down arrows should appear on each
column header. On the header of the column in question,
click the drop down arrow, and select Custom. In the
custom autofilter window, specify "greater than" in the
first field, and 0 in the second. You've now collapsed
the spreadsheed so that only those rows with data are
visible. Select all the rows, and click Edit --> Go to --
Special --> Visible cells only. This highlights only
the visible cells. Copy the resulting selection, and
paste it into a new sheet. The pasted rows will only be
the ones with data.
 
Hi,

I had a similar problem a while ago, and came up with the followin
code which appears to work (more by luck than judgement I have t
say).

It checks the first 1000 rows of column A of each sheet to see i
there's anything there: if not it deletes the row.

Any of you experienced programmers out there: any suggestions on ho
this could be improved would be welcome.

Thanks,

Graham

Option Explicit

Sub Delete_Empty_Rows()
Dim myWkb As Workbook
Dim mySht As Worksheet
Dim i As Integer

Set myWkb = ActiveWorkbook
Application.ScreenUpdating = False
For Each mySht In myWkb.Worksheets
For i = 1000 To 1 Step -1
If Len(mySht.Cells(i, 1).Value) = 0 Then mySht.Rows(i).Delete
Next i
Next mySht

Application.ScreenUpdating = True

End Su
 
why not apply a filter to column A. Then select Blanks from filter drop
down, highlight the rows u wanna delete, then right click, delete.
Then click filter and show ALL.
 
Ah, but that would be the EASY way. You don't want to do things the easy
way, do you? Then where would we all be?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top