PC Review


Reply
Thread Tools Rate Thread

How to auto hide a row if the first cell is blank?

 
 
TG
Guest
Posts: n/a
 
      31st Dec 2008
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 With Quote
 
 
 
 
Gord Dibben
Guest
Posts: n/a
 
      31st Dec 2008
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 <(E-Mail Removed)> 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 With Quote
 
TG
Guest
Posts: n/a
 
      31st Dec 2008
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 <(E-Mail Removed)> 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 With Quote
 
Gord Dibben
Guest
Posts: n/a
 
      31st Dec 2008
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 <(E-Mail Removed)> 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 <(E-Mail Removed)> 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 With Quote
 
Gord Dibben
Guest
Posts: n/a
 
      1st Jan 2009
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 <(E-Mail Removed)> 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 <(E-Mail Removed)> 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 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
auto hide blank rows S A Jameel Microsoft Excel Misc 1 12th Jul 2009 03:36 PM
Auto Hide Blank Rows Brandon Microsoft Excel Misc 1 25th Feb 2009 08:52 PM
Hide columns if specific cell is blank? smduello@gmail.com Microsoft Excel Misc 0 21st May 2008 05:29 PM
Can you create a formula to hide a row if a cell is blank? =?Utf-8?B?RWlsZWVu?= Microsoft Excel Misc 2 13th Sep 2007 02:42 AM
auto-hide rows, cell format (# and @), update cell refs, shade cel =?Utf-8?B?TW8y?= Microsoft Excel Misc 0 17th Apr 2007 03:44 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:36 PM.