How can I delete every other row ?

J

Just Me

I like to keep a worksheet for my credit cards and when I copy them and
paste into a worksheet every other row is blank ( is has a light gray fill )
I would like to delete every other row. Can this be done ??
 
M

MartinW

Hi,

One Way
In a blank column put 1 in the first cell and 2 in the second cell.
Highlight both cells, grab the fill handle and drag down to the
end of your data, hold down ctrl before letting go of the left
button. This will give you repeating series of 1 and 2 running
down the sheet. Then go to Data>Filter>Autofilter and
select all the 2's or 1's whichever coincides with your blank rows
Then select the entire rows by their row number right click
and select delete entire rows then turn off autofilter.

HTH
Martin
 
J

Just Me

Thanks, I tried but found out that the rows I want to delete must be merged
together because there is no columns in those rows.

any suggestions??
 
M

MartinW

Hi

You can't have rows without columns.
Make a copy of your workbook. Then select your data and
goto Format>Cells>Alignment Tab and uncheck merge cells.
Now what does your data look like? You may need to go into
more detail as it is all sounding a little bit confusing at the moment.

HTH
Martin
 
B

Bob Phillips

If doing it regularly, a macro tied to a button seems simplest

Sub ProcessData()
Const TEST_COLOUR As Long = 15 '<=== gray, change to suit
Dim iLastRow As Long
Dim i As Long
With ActiveSheet
iLastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
For i = iLastRow + 1 To 1 Step -1
If .Cells(i, "A").Value = "" And _
.Cells(i, "A").Interior.ColorIndex = TEST_COLOUR Then
.Rows(i).Delete
End If
Next i
End With
End Sub


--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
B

Barbara Wiseman

You could try the
J-Walk Conditional Row Delete
available on this site
http://www.j-walk.com/ss/excel/files/general.htm
I use it a lot for a copy from an internal data base which arrives in excel
with 2 blank lines between each line of data.
You just choose a column in which the lines not required have a blank cell
and activate the add in. When installed it will appear under tools.
Barbara
 
Top