Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() From my master sheet1 I want to select various rows to hide on a corresponding sheet2 ie if sheet1!A3 = X then hide row 3 on sheet2; if sheet1!A6=X then hide row 6 on sheet2 etc etc for any number of rows thanks |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On sheet 1 try this. You might want a master reset to scan all column A on
sheet1 for X's then hide/unhide Sheet1. If you do repost. Private Sub Worksheet_Change(ByVal Target As Range) If Target.Column = 1 Then If Target.Value = "X" Then Sheet2.Rows(Target.Row).EntireRow.Hidden = True Else Sheet2.Rows(Target.Row).EntireRow.Hidden = False End If End If End Sub -- Regards, Nigel "Saintsman" wrote in message ... From my master sheet1 I want to select various rows to hide on a corresponding sheet2 ie if sheet1!A3 = X then hide row 3 on sheet2; if sheet1!A6=X then hide row 6 on sheet2 etc etc for any number of rows thanks |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Nigel Brilliant!! Thanks for the very quick reply as well "Nigel" wrote: On sheet 1 try this. You might want a master reset to scan all column A on sheet1 for X's then hide/unhide Sheet1. If you do repost. Private Sub Worksheet_Change(ByVal Target As Range) If Target.Column = 1 Then If Target.Value = "X" Then Sheet2.Rows(Target.Row).EntireRow.Hidden = True Else Sheet2.Rows(Target.Row).EntireRow.Hidden = False End If End If End Sub -- Regards, Nigel "Saintsman" wrote in message ... From my master sheet1 I want to select various rows to hide on a corresponding sheet2 ie if sheet1!A3 = X then hide row 3 on sheet2; if sheet1!A6=X then hide row 6 on sheet2 etc etc for any number of rows thanks |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Nigel The master reset to scan colA for X's and hide/unhide would be realy useful as well!! Thank you "Nigel" wrote: On sheet 1 try this. You might want a master reset to scan all column A on sheet1 for X's then hide/unhide Sheet1. If you do repost. Private Sub Worksheet_Change(ByVal Target As Range) If Target.Column = 1 Then If Target.Value = "X" Then Sheet2.Rows(Target.Row).EntireRow.Hidden = True Else Sheet2.Rows(Target.Row).EntireRow.Hidden = False End If End If End Sub -- Regards, Nigel "Saintsman" wrote in message ... From my master sheet1 I want to select various rows to hide on a corresponding sheet2 ie if sheet1!A3 = X then hide row 3 on sheet2; if sheet1!A6=X then hide row 6 on sheet2 etc etc for any number of rows thanks |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() several ways to do this. You could use the sheet's change event or the sheets calculate event. Here's the code: Option Explicit Private Sub Worksheet_Calculate() CheckForX End Sub Private Sub Worksheet_Change(ByVal Target As Range) If Target.Column = 1 Then CheckForX End Sub Sub CheckForX() Dim addr As String Dim cell As Range Set cell = Range("A:A").Find("X") If Not cell Is Nothing Then addr = cell.Address Do Worksheets("sheet2").Rows(cell.Row).Hidden = True Set cell = Range("A:A").FindNext(cell) Loop Until cell.Address = addr End If End Sub to get to the sheet's code page, just right click the tab and select View Code from the popup menu whenever a cell's value changes - user entry - the change event fires - triggering the change event ... "Saintsman" wrote in message ... From my master sheet1 I want to select various rows to hide on a corresponding sheet2 ie if sheet1!A3 = X then hide row 3 on sheet2; if sheet1!A6=X then hide row 6 on sheet2 etc etc for any number of rows thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to hide rows in a Workbook with multiple sheets with zero valu | Excel Programming | |||
Hide rows with zero's on several sheets within a workbook | Excel Programming | |||
Specify which rows to NOT hide, and have excel hide the rest | Excel Programming | |||
Hide rows and update fileds in different sheets | Excel Discussion (Misc queries) | |||
Hide Rows Across Mulitple Sheets | Excel Programming |