Beleric3380
New Member
- Joined
- Aug 10, 2022
- Messages
- 5
- Office Version
- 2016
- Platform
- Windows
Hello!
I have a macro that expands or collapses rows depending on the value. If we fill in the values ourselves or from the list, then everything works.
I have a macro that expands or collapses rows depending on the value. If we fill in the values ourselves or from the list, then everything works.
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 2 Then
On Error Resume Next
If Target = "Yes" Then
Rows(Target.Row + 1).ShowDetail = Target = "Yes"
ElseIf Target = "No" Then
Rows(Target.Row + 1).ShowDetail = Target = "Yes"
End If
On Error GoTo 0
End If
End Sub