Deleting all but one blank row

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a file created by another program that inserts six blank rows after
each row of data. The exported format is Excel 8.0 Extended (whatever that
means). I found several really helpful suggestions how to delete all of the
blankrows. The one to use the Go To Special command seems to be the easiest.
Unfortunately, I want to keep one blank row as a divder between each data
row. Any suggestions?
 
How about deleting all the blanks, then add a row back.

In fact, if this is just for appearance, you could select all teh used rows and
just double the rowheight.

This makes sorting/filtering/pivottables/charting much easier.

But...

Option Explicit
Sub testme()
Dim iRow As Long
Dim LastRow As Long
Dim FirstRow As Long
Dim wks As Worksheet

Set wks = Worksheets("Sheet1")

With wks
FirstRow = 1
LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row

For iRow = LastRow To FirstRow + 1 Step -1
.Rows(iRow).Insert
Next iRow
End With
End Sub
 

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