Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / April 2008

Tip: Looking for answers? Try searching our database.

Hide Question

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
WGD - 12 Apr 2008 00:49 GMT
Can a HIDE Row(s) or  Column(s) statement be imbedded in an  IF statement?

For instance, what might be the real way to write what I hope is obvious in
the following?

=IF(A1=B1,"Yes",Hide Row x)    where if A1=B1, then Yes is shown, if not
equal, then Row x is hidden.  (Gulp!)

Thank You!
 Wayne
Dave Peterson - 12 Apr 2008 01:00 GMT
Nope.

Formulas can only return values to the cell that they're in.

> Can a HIDE Row(s) or  Column(s) statement be imbedded in an  IF statement?
>
[quoted text clipped - 6 lines]
> Thank You!
>   Wayne

Signature

Dave Peterson

Pete_UK - 12 Apr 2008 01:02 GMT
You can't use a formula to hide a row or column (or to change formatting in
any way) - you would need to use a macro to do that.

Hope this helps.

Pete

> Can a HIDE Row(s) or  Column(s) statement be imbedded in an  IF statement?
>
[quoted text clipped - 6 lines]
> Thank You!
>  Wayne
Shane Devenshire - 12 Apr 2008 04:41 GMT
Hi,

Of course you can add VBA which is triggered by the results of a
calculation.   For example if you put the formula in cell C3 of Sheet1 and
named that cell myCell and you want to hide row 2 if the formula returns
anything other than "Yes", then the following code would be added to the
Sheet1 code module:

Private Sub Worksheet_Calculate()
   If Range("myCell") = "Yes" Then
      Rows("2:2").EntireRow.Hidden = False
   Else
       Rows("2:2").EntireRow.Hidden = True
   End If
End Sub

Cheers,
Shane Devenshire
Microsoft Excel MVP

> Can a HIDE Row(s) or  Column(s) statement be imbedded in an  IF statement?
>
[quoted text clipped - 6 lines]
> Thank You!
>  Wayne
Mbt6 - 12 Apr 2008 09:37 GMT
You could use conditional formatting in the row you want to hide. IF A1=B1
change font to white. It doesn't really hide the full row, but it would make
it not visible....it's a crappy work around, but it might work.

> Can a HIDE Row(s) or  Column(s) statement be imbedded in an  IF statement?
>
[quoted text clipped - 6 lines]
> Thank You!
>  Wayne
WGD - 12 Apr 2008 20:38 GMT
Appreciative!   Thought I would give it a whirl!  Tks.   Wayne

> Can a HIDE Row(s) or  Column(s) statement be imbedded in an  IF statement?
>
[quoted text clipped - 6 lines]
> Thank You!
>  Wayne

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.