Delete Blank Rows
Perfect - this code did exactly what I needed it for! Thanks!
"Lori" wrote:
I meant to say A1 should be active initially, well done for following the
instructions.
It's actually just three steps on the undo/redo dropdownlist and should be
recordable without a fixed range. Here's a reduced version:
Sub HideDeleteReveal()
Cells.ColumnDifferences(Range("IV65536")).EntireRo w.Hidden = True
Cells.SpecialCells(xlCellTypeVisible).Delete Shift:=xlUp
Cells.EntireRow.Hidden = False
End Sub
"Heather" wrote:
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
|