Deleting every-other row in a spread sheet

G

Guest

I have a spreadsheet in excell that contains info imported from word. As a
result every-other row is blank. I would like to erase these empty rows so if
anyone knows how to go about this it would be gratefully appreciated!!

Thanks in advance
Steve
 
G

Guest

Smintey,

If you a familiar with VBA, you can delete the rows via code. For example,
this procedure deletes rows with empty cells in column A:

Sub DeleteRows()
Dim lLastRow As Long
Dim Rng As Range
Application.ScreenUpdating = False
Rows(1).Insert
Range("A1").Value = "Temp"
With ActiveSheet
.UsedRange
lLastRow = .Cells.SpecialCells(xlCellTypeLastCell).Row
Set Rng = Range("A1", Cells(lLastRow, "A"))
Rng.AutoFilter Field:=1, Criteria1:=" "
Rng.SpecialCells(xlCellTypeVisible).EntireRow.Delete
.UsedRange
End With
End Sub
 
B

Bob Umlas

If you sort them, the blanks will all go to the bottom.
If that option doesn't work for you, you can enter 0,1,0,1,0,1,0,... down an
unused column, where the 1's correspond to the blank rows, then sort by this
column, then delete the 1's at the bottom.

I'm leading a FREE 1-hour online Webinar on Excel Tips & Tricks.
Dec 16, Jan 14, Jan 27 from 4-5PM (each session is the same).
If interested, go to http://www.iil.com, click on the yellow/orange
"Try a free webinar" link on the left side, click the Microsoft Excel
Tips & Tricks link, follow instructions to register.
 
K

Ken Macksey

Hi

Make a backup copy of your workbook first, then you could use something like

For i = 20 To 2 Step -2
Rows(i & ":" & i).Select
Selection.Delete Shift:=xlUp
Next i

Where 20 is the row number of the last blank row under the last data row and
2 is the first blank row under the first data row.

Be sure to get the numbers right so you don't delete any data.

HTH

Ken
 
G

Gord Dibben

Steve

Select a column.

F5>Special>Blanks

Edit>Delete>Entire Row

Gord Dibben Excel MVP
 

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

Top