Hi All!
I'm trying to ungroup the rows based on condition in the cell. Trying below code, but it doesn't work. Would you pls take a look?
Sub Worksheet_Change(ByVal Target As Range)
With ActiveSheet
If .Range("B20").Value = "Yes" Then
With .Range("A25").EntireRow
If .ShowDetail = False Then
.ShowDetail = True
End If
End With
ElseIf Range("B20").Value = "No" Then
With .Range("A25").EntireRow
If .ShowDetail = False Then
.ShowDetail = True
End If
End With
End If
End With
End Sub
I'm trying to ungroup the rows based on condition in the cell. Trying below code, but it doesn't work. Would you pls take a look?
Sub Worksheet_Change(ByVal Target As Range)
With ActiveSheet
If .Range("B20").Value = "Yes" Then
With .Range("A25").EntireRow
If .ShowDetail = False Then
.ShowDetail = True
End If
End With
ElseIf Range("B20").Value = "No" Then
With .Range("A25").EntireRow
If .ShowDetail = False Then
.ShowDetail = True
End If
End With
End If
End With
End Sub