Rows Keep Unhiding

ERed1

Board Regular
Joined
Jun 26, 2019
Messages
104
Hey everyone,

So in my worksheet I have a lot of drop downs. Some are dependent on some are not. A few of the rows I have hide if "No" is selected in the drop down. After I use another drop down, the row un-hides itself. Does anyone have a solution to this issue?

Thanks in advance.

Here is a clip of the code that is hiding the rows:
If Target.Column = 2 And Target.Row = 55 Then
If Target.Value = "No" Then
Application.Rows("56").Select
Application.Selection.EntireRow.Hidden = True
ElseIf Target.Value = "Yes" Then
Application.Rows("56").Select
Application.Selection.EntireRow.Hidden = False
End If
End If
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
It would help if you showed the entire code, rather than just the bit that works. ;)
 
Upvote 0
There is a lot of code lol. So here it is for the section. I think I just figure it out, but I don't know how I would fix it. Here is the Code


'Hide Cells'
If Range("B16").Value = "Pizza" Then
Rows("21:49").EntireRow.Hidden = True
Rows("50:65").EntireRow.Hidden = False
Rows("66:129").EntireRow.Hidden = True
End If



If Target.Column = 2 And Target.Row = 55 Then
If Target.Value = "No" Then
Application.Rows("56").Select
Application.Selection.EntireRow.Hidden = True
ElseIf Target.Value = "Yes" Then
Application.Rows("56").Select
Application.Selection.EntireRow.Hidden = False
End If
End If
 
Upvote 0
The Row that keeps appear is 56, but I know that is because of the way I have the rows staying appeared from the first code.
 
Upvote 0
Are both of those codes in the same procedure?
 
Upvote 0
In that case try
Code:
If Range("B16").Value = "Pizza" Then
   Rows("21:49").EntireRow.Hidden = True
   Rows("50:65").EntireRow.Hidden = False
   Rows("66:129").EntireRow.Hidden = True
   If Range("B55").Value = "No" Then Rows(56).Hidden = True
End If
 
Upvote 0
In that case try
Code:
If Range("B16").Value = "Pizza" Then
   Rows("21:49").EntireRow.Hidden = True
   Rows("50:65").EntireRow.Hidden = False
   Rows("66:129").EntireRow.Hidden = True
   If Range("B55").Value = "No" Then Rows(56).Hidden = True
End If


That worked Perfectly! Thank you!
 
Upvote 0
You're welcome & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,241
Members
452,622
Latest member
Laura_PinksBTHFT

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top