New/Beginner in VBA here -- in one of my workbook sheets, I have two dropdowns in two different cells (named the cells "Unit_Mix_Option" and "Ops Option") where I can select certain text (either "simple" or "detailed"). When I select "detailed", I want it to pull up different sheets listed below. However, I believe that the code I'm using below (I just added this code by right-clicking on the tab and adding it to the "view code" section) is causing my workbook to become unstable. After adding it, I'm finding that my excel freezes when I open up some grouped cells on a different sheet (never happened before adding this code). Do you think that the way its written below is causing this separate issue in another part of my workbook? If so, is there another way for me to code this?
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = Me.Range("Unit_Mix_Option").Address Then
If Target.Value = "Detailed" Then
Sheets("Detailed Rent Model").Visible = True
Sheets("RR Summary").Visible = True
Else
Sheets("Detailed Rent Model").Visible = False
Sheets("RR Summary").Visible = False
End If
End If
If Target.Address = Me.Range("Ops_Option").Address Then
If Target.Value = "Detailed" Then
Sheets("T12 Ops").Visible = True
Sheets("2019 Ops").Visible = True
Sheets("2018 Ops").Visible = True
Else
Sheets("T12 Ops").Visible = False
Sheets("2019 Ops").Visible = False
Sheets("2018 Ops").Visible = False
End If
End If
End Sub
Display More