I just added a ElseIf at the end and another Rows12_17 Boolean to track status
However ...
D12 is value Yes - Rows 12-17 are not hidden
D12 value is No - Rows 12-17 are hidden
D12 value is NA - Rows 12-17 are hidden
D12 value is Select Answer - Rows 12-17 are not hidden
I was trying to copy the information for the coding of rows 88-47 and add this, but I am not doing it right. Thanks for being patient with me. This code I got from Paul works great, I just need to incorporate the 12-17 row info above, and I will be all done! Again thanks so much!!
... if Row 12 is Hidden because of D12 = "No", how would you put in "Yes"?
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim v As Variant
Dim r As Range
Dim Rows39_47 As Boolean, Rows12_17 As Boolean
Set r = Target.Cells(1, 1)
If Len(r.Value) = 0 Then Exit Sub ' catch a Clear
If Not Application.Intersect(Range("B2"), Target) Is Nothing Then
Application.ScreenUpdating = False
Rows39_47 = Me.Rows("39:47").Hidden
Rows12_17 = Me.Rows("12:17").Hidden
Me.Rows.Hidden = False
Me.Rows("39:47").Hidden = Rows39_47
Me.Rows("12:17").Hidden = Rows12_17
Select Case UCase(r.Value)
Case Is = "ACSA"
For Each v In Array(24, 25, 35, 36, 57, 58, 60)
Me.Rows(v).Hidden = True
Next
Case Is = "CSA"
For Each v In Array(57, 58, 60)
Me.Rows(v).Hidden = True
Next
Case Is = "ASA", "SASA"
For Each v In Array(24, 25, 30, 31, 35, 36, 50, 57, 58, 59, 60)
Me.Rows(v).Hidden = True
Next
Case Is = "ACA"
For Each v In Array(24, 25, 30, 31, 35, 36, 50, 59, 60)
Me.Rows(v).Hidden = True
Next
Case Is = "PLEASE SELECT ROLE CODE"
' empty for completeness
End Select
Application.ScreenUpdating = True
ElseIf Not Application.Intersect(Range("D38"), Target) Is Nothing Then
Application.ScreenUpdating = False
Select Case UCase(r.Value)
Case Is = "SELECT ANSWER", "NO"
Me.Rows("39:47").Hidden = False
Case Is = "YES", "NA"
Me.Rows("39:47").Hidden = True
Case Else
Me.Rows("39:47").Hidden = False
End Select
Application.ScreenUpdating = True
ElseIf Not Application.Intersect(Range("D12"), Target) Is Nothing Then
Application.ScreenUpdating = False
Select Case UCase(r.Value)
Case Is = "NO", "NA"
Me.Rows("12:17").Hidden = True
Case Is = "YES", "SELECT ANSWER"
Me.Rows("12:17").Hidden = False
Case Else
Me.Rows("12:17").Hidden = False
End Select
Application.ScreenUpdating = True
End If
End Sub
I polished this a bit: combined Case's that had same result, and added a Case Else just in Case (pun intended)