View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.misc
Don Guillett Don Guillett is offline
external usenet poster
 
Posts: 10,124
Default Delete Blank Rows

Cleaned up
lr = Range("a1").SpecialCells(xlLastCell).Row
lc = Range("a1").SpecialCells(xlLastCell).Column

With Range(Cells(1, 1), Cells(lr, lc))
.RowDifferences(Cells(lr, lc)).EntireRow.Hidden = True
.SpecialCells(xlCellTypeVisible).EntireRow.Delete
.Rows.Hidden = False
End With

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Heather" wrote in message
...
Thank you for all your help, I tried all your solutions but the two that
came
out top were Don and Lori. Don's code worked but took a bit of time,
Lori's
method was quick and I'm impressed by all the keyboard shortcuts!
I recorded Lori's method and heres a copy of the code. It does have a cell
reference in it, which I moved to Z10000 to cover all my likely
requirements,
maybe one of you experts can "generalise" it.

Thanks again,
Heather

Sub HideDeleteReveal()
'
' HideDeleteReveal Macro
' Hides Rows with Data, Deletes Blank Rows, and Reveals Data
'

'
Range("A1").Select
Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select
Range("A1:Z10000").Select
Range("Z10000").Activate
Selection.RowDifferences(ActiveCell).Select
Selection.EntireRow.Hidden = True
Range("A1").Select
Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select
Selection.SpecialCells(xlCellTypeVisible).Select
Selection.EntireRow.Delete
Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select
Selection.EntireRow.Hidden = False
Range("A1").Select
End Sub