Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default How to auto hide a row if the first cell is blank?

Here is some revised code which works on two rows with formulas in A14 and
A25 which return a value or ""

Private Sub Worksheet_Calculate()
Const MyCells As String = "A14,A25" 'adjust the range to suit
On Error GoTo stoppit
Application.EnableEvents = False
For Each cell In Me.Range(MyCells)
With cell
If .Value = "" Then
.EntireRow.Hidden = True
Else
.EntireRow.Hidden = False
End If
End With
Next
stoppit:
Application.EnableEvents = True
End Sub


Gord


On Wed, 31 Dec 2008 15:34:23 -0800, Gord Dibben <gorddibbATshawDOTca wrote:

Always best to state which "other row" and what does the dropdown menu have
to do with it?

What criterion would be used to hide the row and in which cell is that
criterion?

If you hide the row based a value you would have no access to the menu. Is
that what you want?


Gord


On Wed, 31 Dec 2008 12:48:00 -0800, TG wrote:

Thank you very Much Gord, this is exactly what i was looking for for this
paticular situation. However, I have another row that i would like to do the
same to but it has a drop down menu on a cell on that row. Can I do the same
while also hiding that particular drowdown menu?

Any Ideas?

"Gord Dibben" wrote:

First, change your formula in A25 to

=IF(A24=33,"Please Input Data","")

note: no space in last argument and quotes not needed for numeric entries.

Then copy/paste this into your sheet module.

Private Sub Worksheet_Calculate()
On Error GoTo stoppit
Application.EnableEvents = False
With Me.Range("A25")
If .Value = "" Then
.EntireRow.Hidden = True
Else
.EntireRow.Hidden = False
End If
End With
stoppit:
Application.EnableEvents = True
End Sub


Gord Dibben MS Excel MVP


On Wed, 31 Dec 2008 10:18:07 -0800, TG wrote:

Ok I have checked for postings on this problem but none of them have an
answer to my "unique" question.

What I want to do is hide an entire row if the first cell is blank but the
"blank" cell has a formula.
For example:
Let’s say cell A25 has the following formula if(A24="33","Please input
data"," "), so if A24 does not have the number 33 or if it is blank then the
cell A25 will be blank as well, therefore I want the whole entire row to
hide. If A24 has the number 33 then the row should appear with the cell A25
showing "please input data".

I have found similar problems that have solutions that work but only if the
cell is completely blank and with no "hidden" formulas.
(I am by no means well off with VBA or programming, but ill try it if that
is the only way to do so.)

I hope I make some sense


Thank you in advance.
TG



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
auto hide blank rows S A Jameel Excel Discussion (Misc queries) 1 July 12th 09 03:36 PM
Auto Hide Blank Rows Gord Dibben Excel Discussion (Misc queries) 0 February 25th 09 08:52 PM
Hide columns if specific cell is blank? [email protected] Excel Discussion (Misc queries) 0 May 21st 08 05:29 PM
auto-hide rows, cell format (# and @), update cell refs, shade cel Mo2 Excel Discussion (Misc queries) 0 April 17th 07 03:44 AM
macro to hide rows if cell is blank Shooter Excel Worksheet Functions 3 September 28th 05 10:55 PM


All times are GMT +1. The time now is 10:26 PM.

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"