Can Anyone please help me? I am struggling with the code for a button to show/hie specific rows:
Sub ownershipQSE()
If Cells(2, "I").Value = "Large Enterprise" Then
Select Case Rows("160:194").Hidden
Case Is = True
Rows("160:178").Hidden = False
Rows("5:151").Hidden = True
Rows("180:194").Hidden = True
Case Is = False
Rows("160:194").Hidden = True
Rows("5:151").Hidden = False
End Select
ElseIf Cells(2, "I").Value = "Qualifying Small Enterprise" Then
Select Case Rows("160:194").Hidden
Case Is = True
Rows("160:178").Hidden = True
Rows("5:151").Hidden = True
Rows("180:194").Hidden = False
Case Is = False
Rows("160:194").Hidden = True
Rows("5:151").Hidden = False
End Select
End If
End Sub
Let us assume Cell "I2" can be two different variables. The two variables is "Large enterprise" and "Qualifying Small Enterprise". When cell I2 is "large", then the code should hide rows 160:178, hide rows 5:151 but show 180:194. Therefore, when it is clicked again, it only shows rows 5:151, but hides rows 160:194. When cell I2 is "Qualifying Small Enterprise" then it needs to swap around when the button is clicked i.e. 180:194 is shown, and 160:178 is hidden, with the other features staying the same. The "Qualifying Small Enterprise" part does not want to work. It does not show row 5:151 when the button is clicked again after it has shows row 180:194. I have attached the sheet for your attention. can anyone please help, as I do not know what I am doing wrong.
Bookmarks