Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I need a VBA code to automatically hide or unhide a row in one sheet based
upon the value is a cell on another sheet. Example: If Sheet1, cell A1 = 0, then Sheet2, row 5 is hiden. If Sheet1, cell A1 0, then Sheet2, row 5 is visible. Suggestions? |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Try: will unhide if not 0 (blank or < 0)
Sub HideRow() If Worksheets("sheet1").Range("A1") = 0 Then Worksheets("sheet2").Rows(5).EntireRow.Hidden = True Else Worksheets("sheet2").Rows(5).EntireRow.Hidden = False End If End Sub "TDC" wrote: I need a VBA code to automatically hide or unhide a row in one sheet based upon the value is a cell on another sheet. Example: If Sheet1, cell A1 = 0, then Sheet2, row 5 is hiden. If Sheet1, cell A1 0, then Sheet2, row 5 is visible. Suggestions? |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
for the row to automatically get hidden a Worksheet change Event need to be
added into the code. Install as follows 1) right click tab on bottom of worksheet labeled Sheet1. 2) Select view Code 3) Copy subroutine below and paste into VBA Code window. Sub Worksheet_Change(ByVal Target As Range) If (Target.Row = 1) And (Target.Column = 1) And _ (Target = 0) Then Worksheets("sheet2").Rows(5).EntireRow.Hidden = True Else Worksheets("sheet2").Rows(5).EntireRow.Hidden = False End If End Sub "TDC" wrote: I need a VBA code to automatically hide or unhide a row in one sheet based upon the value is a cell on another sheet. Example: If Sheet1, cell A1 = 0, then Sheet2, row 5 is hiden. If Sheet1, cell A1 0, then Sheet2, row 5 is visible. Suggestions? |
#4
![]() |
|||
|
|||
![]() Formula:
Formula:
__________________
I am not human. I am an Excel Wizard |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
d worksheet bar is being hide | Excel Worksheet Functions | |||
how to hide worksheet using VB | Excel Worksheet Functions | |||
Hide worksheet | Excel Worksheet Functions | |||
hide worksheet | Excel Discussion (Misc queries) | |||
How do I hide a worksheet in Excel and use a password to un-hide . | Excel Discussion (Misc queries) |