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

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
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,224,823
Messages
6,181,169
Members
453,021
Latest member
Justyna P

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