View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
Daniel.C[_2_] Daniel.C[_2_] is offline
external usenet poster
 
Posts: 105
Default Automatically hide a row if it is empty

Hi.
Paste the following code in the sheet module. It's assuming to check
formulae from cells A5:A10.

Private Sub Worksheet_Calculate()
Application.EnableEvents = False
For i = 5 To 10
If Cells(i, 1) = "" And Cells(i, 1).HasFormula Then
Rows(i).Hidden = True
Else
Rows(i).Hidden = False
End If
Next i
Application.EnableEvents = True
End Sub

HTH
Daniel

Hi,

I would like Excel to hide a couple of rows if a formula input in the cells
of that row results in "" and show them if the formula shows numbers. Has
anyone worked out how to do it?

Thanks
Steve