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


"dford" wrote:

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.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 50
Default 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:A4 8")) 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

"Gary''s Student" wrote:

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


"dford" wrote:

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.

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
clear range of cells if another becomes blank bgg Excel Worksheet Functions 3 January 17th 07 11:32 PM
Sorting and Eliminating Blank Cells in Formula range Santas Helper Excel Worksheet Functions 3 November 24th 06 07:13 PM
Simple Sumproduct of 2 Columns, with some blank cells in range SteveC Excel Discussion (Misc queries) 4 May 12th 06 07:20 PM
Copy/Paste how to avoid the copy of formula cells w/o calc values Dennis Excel Discussion (Misc queries) 10 March 2nd 06 10:47 PM
Counting empty cells within a range of cells Rosehill - ExcelForums.com New Users to Excel 2 May 2nd 05 08:53 AM


All times are GMT +1. The time now is 12:08 AM.

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

About Us

"It's about Microsoft Excel"