View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Claus Busch Claus Busch is offline
external usenet poster
 
Posts: 3,872
Default Change event for all sheets in WBook

Hi Howard,

Am Thu, 2 Feb 2017 23:46:22 -0800 (PST) schrieb L. Howard:

This works to hide/unhide for only the activesheet.

I need if I enter CS or SA on ANY sheet cell H8, then ALL sheets hide for that case, regardless what the other sheets display in cell H8.


do you want to hide the rows if CS or SA is entered in H8? With any
other entry rows will unhide?
Then 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
Rows("23:28").Hidden = flag
Next
End Sub


Regards
Claus B.
--
Windows10
Office 2016