PC Review


Reply
Thread Tools Rate Thread

Automatically hide a row if it is empty

 
 
Vil
Guest
Posts: n/a
 
      19th Nov 2008
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


 
Reply With Quote
 
 
 
 
Daniel.C
Guest
Posts: n/a
 
      19th Nov 2008
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



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I automatically hide empty columns in Excel? Ned Mains Microsoft Excel Misc 2 19th Jun 2008 10:58 PM
Is there a way to automatically hide empty rows? =?Utf-8?B?Q2hyaXN0aW5l?= Microsoft Excel Worksheet Functions 1 12th Apr 2007 10:22 PM
Hide when Empty. How to do this? Shapper Microsoft ASP .NET 1 17th Jun 2005 06:27 AM
Automatically hide or delete empty rows after IF ? Lost! Microsoft Excel Programming 0 2nd Jun 2005 10:13 PM
Re: Hide row with empty cells Trevor Shuttleworth Microsoft Excel Programming 0 26th Sep 2003 10:13 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:15 PM.