Hi - I have this code in the sheet tab and it executes on a worksheet change. I'm assuming there is a much easier way to do this? Sheets are labeled by their codenames.
Thanks!
Thanks!
Code:
If Not Intersect(Target, Range("A3")) Is Nothing Then Rows.Hidden = False
Select Case Target.Value
Case 1
Range("41:164").EntireRow.Hidden = True
Range("220:259").EntireRow.Hidden = True
Range("A41") = 2
Range("A43").ClearContents
Range("A103") = 3
Range("A105").ClearContents
Range("B43:G92").ClearContents
Range("B105:G154").ClearContents
Range("F95:G95").ClearContents
Range("F97:G99").ClearContents
Sheet2.Visible = xlSheetHidden
Sheet5.Visible = xlSheetHidden
Sheet7.Visible = xlSheetHidden
Sheet9.Visible = xlSheetHidden
Sheet10.Visible = xlSheetHidden
Sheet13.Visible = xlSheetHidden
Sheet22.Visible = xlSheetHidden
Sheet23.Visible = xlSheetHidden
Sheet24.Visible = xlSheetHidden
Sheet25.Visible = xlSheetHidden
Sheet26.Visible = xlSheetHidden
Sheet27.Visible = xlSheetHidden
Case 2
Range("102:163").EntireRow.Hidden = True
Range("240:259").EntireRow.Hidden = True
Range("A41").ClearContents
Range("A43") = 1
Range("A103") = 3
Range("A105").ClearContents
Range("B105:G154").ClearContents
Range("F95:G95").ClearContents
Range("F97:G99").ClearContents
Sheet5.Visible = xlSheetVisible
Sheet10.Visible = xlSheetVisible
Sheet13.Visible = xlSheetVisible
Sheet2.Visible = xlSheetVisible
Sheet7.Visible = xlSheetVisible
Sheet9.Visible = xlSheetVisible
Sheet22.Visible = xlSheetHidden
Sheet23.Visible = xlSheetHidden
Sheet24.Visible = xlSheetHidden
Sheet25.Visible = xlSheetHidden
Sheet26.Visible = xlSheetHidden
Sheet27.Visible = xlSheetHidden
Case 3
Range("41:163").EntireRow.Hidden = False
Range("220:259").EntireRow.Hidden = False
Range("A43") = 1
Range("A105") = 1
Sheet5.Visible = xlSheetVisible
Sheet10.Visible = xlSheetVisible
Sheet13.Visible = xlSheetVisible
Sheet2.Visible = xlSheetVisible
Sheet7.Visible = xlSheetVisible
Sheet9.Visible = xlSheetVisible
Sheet22.Visible = xlSheetVisible
Sheet23.Visible = xlSheetVisible
Sheet24.Visible = xlSheetVisible
Sheet25.Visible = xlSheetVisible
Sheet26.Visible = xlSheetVisible
Sheet27.Visible = xlSheetVisible
End Select
End If