ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Hiding blank rows (https://www.excelbanter.com/excel-programming/354684-hiding-blank-rows.html)

pkeegs

Hiding blank rows
 
I have a named range which includes some rows which are empty. When I apply
subtotals using a macro, all the empty rows end up in the bottom category.
What code can I include in the macro to hide all the empty rows.

Norman Jones

Hiding blank rows
 
Hi P,

Try:

Public Sub Tester001()
On Error Resume Next
Range("NamedRange").Columns(1).SpecialCells(xlBlan ks). _
EntireRow.Hidden = True
On Error GoTo 0

End Sub
'<<=============

Change "NamedRange" to your range of interest.

---
Regards,
Norman



"pkeegs" wrote in message
...
I have a named range which includes some rows which are empty. When I apply
subtotals using a macro, all the empty rows end up in the bottom category.
What code can I include in the macro to hide all the empty rows.





All times are GMT +1. The time now is 03:36 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com