Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 28
Default 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.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,979
Default 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

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,836
Default 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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
collapsing rows Jim S. Excel Worksheet Functions 5 December 5th 07 10:17 PM
using macro to copy and paste filtered results, what if blank? priceyindevon Excel Worksheet Functions 2 December 14th 06 10:09 AM
Expanding and Collapsing QPapillon Excel Discussion (Misc queries) 2 March 31st 06 09:41 PM
Collapsing/Hiding radio and macro buttons Lance Gray Excel Discussion (Misc queries) 1 December 20th 05 04:50 PM
Prevent A Macro From Running If SpreadSheet is Filtered carl Excel Worksheet Functions 1 June 22nd 05 04:04 PM


All times are GMT +1. The time now is 01:21 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"