Hide row if all cells in another range are blank  
Author Message
suziemarie





PostPosted: Sat Feb 03 09:36:00 CST 2007 Top

Excel Misc >> Hide row if all cells in another range are blank

I would like to hide a row if all cells in another range are blank. Example:
If A4:A8 are all blank, then hide row A3.

Excel88  
 
 
GarysStudent





PostPosted: Sat Feb 03 09:36:00 CST 2007 Top

Excel Misc >> Hide row if all cells in another range are blank This can easily be modified for any range and row:

Sub dford()
If Application.WorksheetFunction.CountA(Range("A4:A8")) > 0 Then
Else
Rows(3).EntireRow.Hidden = True
End If
End Sub

--
Gary''s Student
gsnu200703




> I would like to hide a row if all cells in another range are blank. Example:
> If A4:A8 are all blank, then hide row A3.
 
 
dford





PostPosted: Sat Feb 03 12:21:01 CST 2007 Top

Excel Misc >> Hide row if all cells in another range are blank This works fine. But now I am trying to add it to an existig macro. It skips
over the code you suggested earlier. Below is the macro I am trying to use.

Sub HideRows()
'
' HideRows Macro
' Macro recorded 2/2/2007 by Doug
'

'
ActiveSheet.Unprotect
If Application.WorksheetFunction.CountA(Range("A39:A48")) > 0 Then
Else
Rows(38).EntireRow.Hidden = True
End If
Application.Goto Range("BM4"), True
Range("BP4:BP333").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="<>0", Operator:=xlAnd
Range("A1").Select
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
End Sub



> This can easily be modified for any range and row:
>
> Sub dford()
> If Application.WorksheetFunction.CountA(Range("A4:A8")) > 0 Then
> Else
> Rows(3).EntireRow.Hidden = True
> End If
> End Sub
>
> --
> Gary''s Student
> gsnu200703
>
>

>
> > I would like to hide a row if all cells in another range are blank. Example:
> > If A4:A8 are all blank, then hide row A3.