Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
How can i hide a row or delete
Is there a way i can hide or delete a whole row if the sum of the cell is = 0
example if A5=0 delete or hide the whole row. Thanks |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
How can i hide a row or delete
If A5 is zero then this will hide row 5
Private Sub Worksheet_Change(ByVal Target As Range) If Cells(5, 1).Value = 0 Then Rows("5:5").Select Selection.EntireRow.Hidden = True End If End Sub "algebroni" wrote: Is there a way i can hide or delete a whole row if the sum of the cell is = 0 example if A5=0 delete or hide the whole row. Thanks |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
How can i hide a row or delete
Sorry it's O5 not A5 and is there a function that can do that
"Mike" wrote: If A5 is zero then this will hide row 5 Private Sub Worksheet_Change(ByVal Target As Range) If Cells(5, 1).Value = 0 Then Rows("5:5").Select Selection.EntireRow.Hidden = True End If End Sub "algebroni" wrote: Is there a way i can hide or delete a whole row if the sum of the cell is = 0 example if A5=0 delete or hide the whole row. Thanks |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
How can i hide a row or delete
5,15 instead of 5,1
"algebroni" wrote: Sorry it's O5 not A5 and is there a function that can do that "Mike" wrote: If A5 is zero then this will hide row 5 Private Sub Worksheet_Change(ByVal Target As Range) If Cells(5, 1).Value = 0 Then Rows("5:5").Select Selection.EntireRow.Hidden = True End If End Sub "algebroni" wrote: Is there a way i can hide or delete a whole row if the sum of the cell is = 0 example if A5=0 delete or hide the whole row. Thanks |
#5
Posted to microsoft.public.excel.misc
|
|||
|
|||
How can i hide a row or delete
Functions can only return values, not make formatting changes.
Is the value in O5 the result of a formula in O5? Change event code is not triggered by a formula-generated value being changed. Only triggered when you actually Enter something in the cell. Try this if a formula-generated value in O5 Private Sub Worksheet_Calculate() On Error GoTo endit Application.EnableEvents = False With Me.Range("O5") If (.Value) = 0 Then .EntireRow.Hidden = True Else: .EntireRow.Hidden = False End If End With endit: Application.EnableEvents = True End Sub This is sheet event code. Right-click on your sheet tab and "View Code". Copy/paste into that sheet module. Gord Dibben MS Excel MVP On Fri, 9 Feb 2007 12:01:01 -0800, algebroni wrote: Sorry it's O5 not A5 and is there a function that can do that "Mike" wrote: If A5 is zero then this will hide row 5 Private Sub Worksheet_Change(ByVal Target As Range) If Cells(5, 1).Value = 0 Then Rows("5:5").Select Selection.EntireRow.Hidden = True End If End Sub "algebroni" wrote: Is there a way i can hide or delete a whole row if the sum of the cell is = 0 example if A5=0 delete or hide the whole row. Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Hide rows of cells that are blank | Excel Discussion (Misc queries) | |||
I can't delete an image in excel workbook | Excel Discussion (Misc queries) | |||
How to Delete Rows in Excel In a Do Loop | Excel Worksheet Functions | |||
I can't delete a cell without deleting a row | Excel Discussion (Misc queries) | |||
How do I delete columns and rows in Excel, not just hide them | Excel Discussion (Misc queries) |