Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How do you hide a row if a certain cell equals zero?

Hi
I'm trying to create a shipping report for work, based on another
spreadsheet. I need to know how to hide and entire row once all units have
shipped. As it is now, the report just lists "units due" as "0". Is there a
formula that will hide that row when the "units due" cell is "0".

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 989
Default How do you hide a row if a certain cell equals zero?

This code has two functions. First, it will unhide any rows that you may
have previously hidden that no longer contain a '0' value... and the second
part hides all the rows that do contain '0' values.



Sub Your_name_here

Dim i As Long

With Application
.ScreenUpdating = False

Sheets("Sheet Name Here").Select
Range("Range of cells you are checking - the column").Select
For i = Selection.Cells.Count To 1 Step -1
If Selection.Cells(i) < 0 Then
Selection.Rows(i).EntireRow.Hidden = False
End If
Next i

Sheets("Sheet Name Here").Select
Range("Range of cells you are checking").Select
For i = Selection.Cells.Count To 1 Step -1
If Selection.Cells(i) = 0 Then
Selection.Rows(i).EntireRow.Hidden = True
End If
Next i

end with
end sub

"msqueenjessica" wrote:

Hi
I'm trying to create a shipping report for work, based on another
spreadsheet. I need to know how to hide and entire row once all units have
shipped. As it is now, the report just lists "units due" as "0". Is there a
formula that will hide that row when the "units due" cell is "0".

Thanks

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default How do you hide a row if a certain cell equals zero?

You may want to apply Data|Filter|autofilter to that range (or just that
column).

Then filter on the non-zero values (custom|does not equal|0)

msqueenjessica wrote:

Hi
I'm trying to create a shipping report for work, based on another
spreadsheet. I need to know how to hide and entire row once all units have
shipped. As it is now, the report just lists "units due" as "0". Is there a
formula that will hide that row when the "units due" cell is "0".

Thanks


--

Dave Peterson
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
If a cell equals _, at the next row that equals _, return value fr CathyH Excel Worksheet Functions 10 May 2nd 07 07:53 PM
If cell is left blank, or equals zero, then cell equals a different cell John McMurry Excel Discussion (Misc queries) 3 April 13th 07 01:14 PM
How to create/run "cell A equals Cell B put Cell C info in Cell D abmb161 Excel Discussion (Misc queries) 5 January 26th 06 06:36 PM
if a:a (range) equals january and c:c equals gas then add g:g ($) BCOz Excel Worksheet Functions 4 December 29th 05 07:40 PM
custom filter does not work when selecting 'equals' X AND 'equals' plindman Excel Discussion (Misc queries) 1 June 1st 05 11:29 PM


All times are GMT +1. The time now is 05:06 PM.

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"