Forum Discussion
chanyuhui :
Apr 26, 2018Copper Contributor
Excel - automatically hiding select rows based on drop down selection
Hi there! I have a drop down selection of 10 items on my dashboard tab and am trying to only show rows 57 to 72 when I select one of them. I am using the following code but somehow it is not working...
Haytham Amairah
Apr 26, 2018Silver Contributor
Hi,
If I understand you well, you want to show rows 57 to 72 when you select the value of 1 from the dropdown list, otherwise, you want to hide them.
I think that the dropdown list in cell B3?
Based on that, please try this code instead:
Private Sub Worksheet_Change(ByVal Target As Range)
If Range("B3") = "1" Then
Rows("57:72").EntireRow.Hidden = False
Else
Rows("57:72").EntireRow.Hidden = True
End If
End Sub
chanyuhui :
Apr 26, 2018Copper Contributor
Thanks Haytham, unfortunately it seems like it is my excel sheet that is causing the problem. The same issue remains (that the bars don't get hidden until I type something into cell J3, after which it does not unhide again). I tried your method on a new excel file and it worked. If you happen to know how I can troubleshoot this issue please let me know. Thank you!
- Haytham AmairahApr 26, 2018Silver Contributor
Hi,
Please provide me with screenshots of your dashboard to figure out what the problem is.
It's best if you can attach the workbook.