Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Can I hide a row conditional upon a cell value?

I want to create a sheet which will serve as a Proforma Invoice displaying
data from a Bill of Materials sheet within the same file. For any line item
where the qty is 0, I would like that row to be hidden so that the Invoice
bears only the line items relevant to the proposed supply.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
~L ~L is offline
external usenet poster
 
Posts: 177
Default Can I hide a row conditional upon a cell value?

You could apply autofiltering to the document by selecting any cell within
your data range (so long as there are no completely blank columns or rows)
going to data filter Autofilter (In 2007, data tab and the filter
button).

Once autofiltering is applied, click on the quantity column's dropdown arrow
(located at the first row of data) and choose 'custom' then 'not equal to'
and input 0 (or in Excel 2007 just click the arrow then uncheck 0).

If you do have completely blank rows, consider Ron de Bruin's code examples
he

http://www.rondebruin.nl/delete.htm

to trim your data down.

"davo1805" wrote:

I want to create a sheet which will serve as a Proforma Invoice displaying
data from a Bill of Materials sheet within the same file. For any line item
where the qty is 0, I would like that row to be hidden so that the Invoice
bears only the line items relevant to the proposed supply.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default Can I hide a row conditional upon a cell value?

To start...........formulas cannot hide anything so you must either filter
manually or use event code.

Depends upon how the quantity is derived which event type to use.

I will assume the value is formula-derived.

Private Sub Worksheet_Calculate()
'Hide rows with formulas that return 0
Dim cell As Range
On Error GoTo endit
Application.EnableEvents = False
Application.ScreenUpdating = False
With Me.UsedRange
.Rows.Hidden = False
For Each cell In .Columns(1).SpecialCells(xlCellTypeFormulas)
If cell.Value = 0 Then cell.EntireRow.Hidden = True
Next cell
End With
endit:
Application.EnableEvents = True
Application.ScreenUpdating = True
End Sub


Gord Dibben MS Excel MVP

On Wed, 10 Dec 2008 15:38:00 -0800, davo1805
wrote:

I want to create a sheet which will serve as a Proforma Invoice displaying
data from a Bill of Materials sheet within the same file. For any line item
where the qty is 0, I would like that row to be hidden so that the Invoice
bears only the line items relevant to the proposed supply.


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
Conditional Format - Hide/Unhide robzrob Excel Worksheet Functions 2 July 22nd 08 03:56 PM
Hide rows with conditional formatting Gerry Verschuuren Excel Discussion (Misc queries) 5 April 8th 07 01:34 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
Can I HIDE cells with a conditional argument? Bob the Builder Excel Worksheet Functions 2 July 22nd 05 10:30 AM


All times are GMT +1. The time now is 06:40 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"