Hi all,
I am in need of your help with vba code below.
My problem is that I am running into (Run-Time error '91': Object Variable or With block variable not set). Currently, I have Cells E73, and E128 to control whether rows hide or not hide. The problem I discovered is from all other cells that contain the same drop-down selection words and the VBA thinks it is an action it needs to take.
I have a drop-down selection of "Included" and "Excluded" on Cells (E26, E40, E51, E62, E73, E84, E95, E106, E117, E128, E139, E150). However, I want the following Cells to trigger whether rows hide or not.
Can you please help me to mark only Cells E73 and E128 to drive if rows hide or not hide, while ignoring the other cell's selection even if it has same wording?
Private Sub Worksheet_Change(ByVal Target As Range)
Dim rng As Range
If Target.CountLarge > 1 Then Exit Sub
Select Case Target.Address(0, 0)
Case "E73"
Set rng = Sheets("Proposal").Rows("349:403")
Case "E128"
Set rng = Sheets("Proposal").Rows("404:462")
End Select
Select Case Target.Value
Case "Included"
rng.Hidden = False
Case "Excluded"
rng.Hidden = True
End Select
End Sub
I am in need of your help with vba code below.
My problem is that I am running into (Run-Time error '91': Object Variable or With block variable not set). Currently, I have Cells E73, and E128 to control whether rows hide or not hide. The problem I discovered is from all other cells that contain the same drop-down selection words and the VBA thinks it is an action it needs to take.
I have a drop-down selection of "Included" and "Excluded" on Cells (E26, E40, E51, E62, E73, E84, E95, E106, E117, E128, E139, E150). However, I want the following Cells to trigger whether rows hide or not.
Can you please help me to mark only Cells E73 and E128 to drive if rows hide or not hide, while ignoring the other cell's selection even if it has same wording?
Private Sub Worksheet_Change(ByVal Target As Range)
Dim rng As Range
If Target.CountLarge > 1 Then Exit Sub
Select Case Target.Address(0, 0)
Case "E73"
Set rng = Sheets("Proposal").Rows("349:403")
Case "E128"
Set rng = Sheets("Proposal").Rows("404:462")
End Select
Select Case Target.Value
Case "Included"
rng.Hidden = False
Case "Excluded"
rng.Hidden = True
End Select
End Sub