![]() |
Collapsing filtered macro
i ran a macro, and it deleted a bunch of error cells, but left a bunch of
blank cells such as the following: a b c how do i get it to collapse to the form: a b c? Prefereably within the same macro. Thanks for any help. |
Collapsing filtered macro
If you sort the range by that column all the blanks should end up at the
bottom. DFrank wrote: i ran a macro, and it deleted a bunch of error cells, but left a bunch of blank cells such as the following: a b c how do i get it to collapse to the form: a b c? Prefereably within the same macro. Thanks for any help. -- Debra Dalgleish Contextures www.contextures.com/tiptech.html Blog: http://blog.contextures.com |
Collapsing filtered macro
this may work for you (if those really are blanks):
Sub HideBlanks() Dim rng As Range On Error Resume Next Range("A1:A20").EntireRow.Hidden = False '< -- Change this range to suit your needs Set rng = Range("A1:A20").SpecialCells(xlBlanks) On Error GoTo 0 If Not rng Is Nothing Then rng.EntireRow.Hidden = True End If End Sub This will unhide the blanks: Sub UnHideBlanks() Dim rng As Range On Error Resume Next Range("A1:A20").EntireRow.Hidden = False Set rng = Range("A1:A20").SpecialCells(xlBlanks) On Error GoTo 0 If Not rng Is Nothing Then rng.EntireRow.Hidden = False End If End Sub Regards, Ryan--- -- RyGuy "Debra Dalgleish" wrote: If you sort the range by that column all the blanks should end up at the bottom. DFrank wrote: i ran a macro, and it deleted a bunch of error cells, but left a bunch of blank cells such as the following: a b c how do i get it to collapse to the form: a b c? Prefereably within the same macro. Thanks for any help. -- Debra Dalgleish Contextures www.contextures.com/tiptech.html Blog: http://blog.contextures.com |
All times are GMT +1. The time now is 01:17 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com