#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Conditional Hide

I wan needing to hide certain rows in a spreadsheet, but not the same ones
each time. I was thinking I may be able to do something like
if the number is cell O = zero then hide that row.

is this possible or is there another way to do it. It is costing me alot of
time at the moment!

Thanks for your time
Helen
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 222
Default Conditional Hide

Yes, it's doable, usually with a worksheet macro of several choices. The
thing you need to decide is if this should happen in realtime on its own,
which would make it difficult to unhide said rows, or if you want it to occur
when you manually run the macro.


--
"Actually, I *am* a rocket scientist." -- JB

Your feedback is appreciated, click YES if this post helped you.


"Admin @ Aust-Mech" wrote:

I wan needing to hide certain rows in a spreadsheet, but not the same ones
each time. I was thinking I may be able to do something like
if the number is cell O = zero then hide that row.

is this possible or is there another way to do it. It is costing me alot of
time at the moment!

Thanks for your time
Helen

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 222
Default Conditional Hide

Here's an on-demand macro you can run to do it:

========
Sub CheckColumnO()
Dim lastrow As Long, rng As Range, cell As Range
lastrow = ActiveSheet.UsedRange.Rows.Count
Set rng = ActiveSheet.Range("O1:O" & lastrow)

For Each cell In rng
If cell.Value = 0 Then cell.EntireRow.Hidden = True
Next cell

End Sub
=========


--
"Actually, I *am* a rocket scientist." -- JB

Your feedback is appreciated, click YES if this post helped you.


"JBeaucaire" wrote:

Yes, it's doable, usually with a worksheet macro of several choices. The
thing you need to decide is if this should happen in realtime on its own,
which would make it difficult to unhide said rows, or if you want it to occur
when you manually run the macro.


--
"Actually, I *am* a rocket scientist." -- JB

Your feedback is appreciated, click YES if this post helped you.


"Admin @ Aust-Mech" wrote:

I wan needing to hide certain rows in a spreadsheet, but not the same ones
each time. I was thinking I may be able to do something like
if the number is cell O = zero then hide that row.

is this possible or is there another way to do it. It is costing me alot of
time at the moment!

Thanks for your time
Helen

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Conditional Hide

Thanks for your advice and effort. I tried the macro you suggested and it
doesn't work. It tends to flick over a few rows repetatively, changes my 0 to
1 and then says 'out of stack space'.

I will admit that I have never written a macro before so my debugging skills
are non-existant.

I certainly appreciate your help and if you have any other ideas, they will
be gratefully received.

Thanks


"JBeaucaire" wrote:

Here's an on-demand macro you can run to do it:

========
Sub CheckColumnO()
Dim lastrow As Long, rng As Range, cell As Range
lastrow = ActiveSheet.UsedRange.Rows.Count
Set rng = ActiveSheet.Range("O1:O" & lastrow)

For Each cell In rng
If cell.Value = 0 Then cell.EntireRow.Hidden = True
Next cell

End Sub
=========


--
"Actually, I *am* a rocket scientist." -- JB

Your feedback is appreciated, click YES if this post helped you.


"JBeaucaire" wrote:

Yes, it's doable, usually with a worksheet macro of several choices. The
thing you need to decide is if this should happen in realtime on its own,
which would make it difficult to unhide said rows, or if you want it to occur
when you manually run the macro.


--
"Actually, I *am* a rocket scientist." -- JB

Your feedback is appreciated, click YES if this post helped you.


"Admin @ Aust-Mech" wrote:

I wan needing to hide certain rows in a spreadsheet, but not the same ones
each time. I was thinking I may be able to do something like
if the number is cell O = zero then hide that row.

is this possible or is there another way to do it. It is costing me alot of
time at the moment!

Thanks for your time
Helen

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 222
Default Conditional Hide

I am testing this on a sheet where I'm just putting 1, 0 and blanks down the
sheet a ways, then running the macro. It hides all the rows with blank or
zero, so the only thing I can think is typo. Be sure to try cut-n-paste from
this message instead of retyping, or get it working on a small sheet first
like I've done above. Once you know it's actually working, try it again on
your larger data set.


--
"Actually, I *am* a rocket scientist." -- JB

Your feedback is appreciated, click YES if this post helped you.


"Admin @ Aust-Mech" wrote:

Thanks for your advice and effort. I tried the macro you suggested and it
doesn't work. It tends to flick over a few rows repetatively, changes my 0 to
1 and then says 'out of stack space'.

I will admit that I have never written a macro before so my debugging skills
are non-existant.

I certainly appreciate your help and if you have any other ideas, they will
be gratefully received.

Thanks


"JBeaucaire" wrote:

Here's an on-demand macro you can run to do it:

========
Sub CheckColumnO()
Dim lastrow As Long, rng As Range, cell As Range
lastrow = ActiveSheet.UsedRange.Rows.Count
Set rng = ActiveSheet.Range("O1:O" & lastrow)

For Each cell In rng
If cell.Value = 0 Then cell.EntireRow.Hidden = True
Next cell

End Sub
=========




  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,651
Default Conditional Hide

AutoFilter
--
David Biddulph

Admin @ Aust-Mech wrote:
I wan needing to hide certain rows in a spreadsheet, but not the same
ones each time. I was thinking I may be able to do something like
if the number is cell O = zero then hide that row.

is this possible or is there another way to do it. It is costing me
alot of time at the moment!

Thanks for your time
Helen




  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 857
Default Conditional Hide

To Clarify Davids suggestion:

In 2003 select the column which contains the 0's and choose Data, Filter,
AutoFilter. Then open the auto filter drop down and choose Custom, from the
first box on the left choose does not equal, in the second box on the right
enter 0 or whatever you don't want to see and click OK.

In 2007 the same idea just choose Data tab, Filter, then open the filter
drop down and choose Number Filters, Does Not Equal...

Note if you have O rather than 0 then you will see Text Filters in 2007
instead of Number Filters.

--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire


"David Biddulph" wrote:

AutoFilter
--
David Biddulph

Admin @ Aust-Mech wrote:
I wan needing to hide certain rows in a spreadsheet, but not the same
ones each time. I was thinking I may be able to do something like
if the number is cell O = zero then hide that row.

is this possible or is there another way to do it. It is costing me
alot of time at the moment!

Thanks for your time
Helen





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
Can I hide a row conditional upon a cell value? davo1805 Excel Worksheet Functions 2 December 11th 08 12:31 AM
Conditional Format - Hide/Unhide robzrob Excel Worksheet Functions 2 July 22nd 08 03:56 PM
CONDITIONAL HIDE/UNHIDE ROWS [email protected] Excel Discussion (Misc queries) 3 May 15th 07 12:20 PM
Using VBA to Conditional Hide Rows? PBJ Excel Discussion (Misc queries) 1 February 16th 07 06:54 PM
Hide cell value conditional on its value pstar Excel Worksheet Functions 2 January 4th 06 06:28 PM


All times are GMT +1. The time now is 02:33 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"