View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
L. Howard L. Howard is offline
external usenet poster
 
Posts: 852
Default Change event for all sheets in WBook

On Friday, February 3, 2017 at 12:09:27 AM UTC-8, Claus Busch wrote:
Hi again,

Am Fri, 3 Feb 2017 09:06:44 +0100 schrieb Claus Busch:

do you want to hide the rows if CS or SA is entered in H8? With any
other entry rows will unhide?
Then try:


sorry, I am wrong.

Try:

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As
Range)
If Target.Address(0, 0) < "H8" Or Target.Count 1 Then Exit Sub

Dim flag As Boolean

Select Case Target.Value
Case "CS", "SA"
flag = True
Case Else
flag = False
End Select
For Each Sh In Worksheets
With Sh
.Rows("23:28").Hidden = flag
End With
Next
End Sub


Hi Claus,

It hides with CS but does not unhide with SA.

It should hide all if I enter CS on sheet6 and unhide all if I enter SA on sheet2. As an example.

I have the code in the ThisWorkbook module.
Howard