Hide rows based on output from formula

mustang70

New Member
Joined
Oct 30, 2013
Messages
15
Hi I have searched many forums and can't seem to find my answer to this problem

I am working a large quoting program and I need certain rows to automatically hide when I have a cell condition based on a number i.e. if P30=1 I want the row hidden and if P30=2 I want the rows to appear. The numbers can be changed to "true" or "false" if it would work better.
Currently this formula works but only if I got to the P30 cell and click and hit enter - the cell out put is from a differnt sheet and I don't know if that the problem. I need this formual to run all of the time as I make changes to the first sheet and this data is on sheet 4 - this data has a Macro which copys the info and pastes this in Word
I have also tried Autofill with no luck.
There are about 10 other differnt rows I need to hide based on formual outputs - Ideas?

Here is the current formula - only works if I go to the sheet and manauly type 1 or 2 and hit enter, does not work from a formula output

Private Sub Worksheet_Change(ByVal target As Range)
If Range("s30").Value = 1 Then
Rows("34:35").Select
Selection.EntireRow.Hidden = True
Range("s30").Select
ElseIf Range("s30").Value = 2 Then
Rows("34:35").Select
Selection.EntireRow.Hidden = False
Range("s30").Select
End If

End Sub
 
I tried the above code and it doesn't hide the rows for some reason?
The reset macro is needed because this quote can start as one of 3 options and I don't want to select the wrong option when working up my quotes

This is a very large excel program for sure- I have been working on this for well over a year, it saves me hours of time everyday for sure!
 
Upvote 0

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
I tried the above code and it doesn't hide the rows for some reason?
The reset macro is needed because this quote can start as one of 3 options and I don't want to select the wrong option when working up my quotes

This is a very large excel program for sure- I have been working on this for well over a year, it saves me hours of time everyday for sure!

1.) Then assign the combobox to a cell you don't delete Not H11.

2.)This does work. I've tested it. It's case sensitive. Try this to make it case insensitive.
Sheets("quote").Rows("17").Hidden = LCase(Combobox3.Value) = "motorized" ' or <> "motorized"
 
Upvote 0
Got it now :)
Sheets("quote").Rows("17").Hidden = Not LCase(ComboBox3.Value) = "motorized" ' or <> "motorized"
 
Upvote 0

Forum statistics

Threads
1,216,119
Messages
6,128,941
Members
449,480
Latest member
yesitisasport

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