View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.misc
Heather Heather is offline
external usenet poster
 
Posts: 148
Default Delete Blank Rows

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