Hide\Unhide cell based on cell value !!!

hensleyj

New Member
Joined
Apr 2, 2012
Messages
39
Hey anyone,

I am having problems trying to work out a macro to hide/unhide a cell based on a value. The value is derived from a IF statement.

Below is the information you may need, any help would be appreciated. I have looked through the forums and used other suggestions for other posts, but none seem to work.

C14= =IF(C10="","",IF(OR(AND(C10="Business Super Directions"),AND(C10="Personal Super Directions")),"Yes","No"))

So, depending on the selection at C10 from a drop down box, C14 will equal the following;

1) BLANK, if C10 option has yet to be selected
2) Yes
3) No

What i am trying to do is the following;

1) BLANK: Show row 15
2) Yes: Show row 15
3) No: Hide row 15

As the value of C14 could change i need the macro to be able to show the above 3 outcomes.
If the cell changes from No to yes, i need it to unhide the cell.

Also, i have seen in some posts, others were having problems with the cell hiding or unhiding unless you hit the enter button.

I am hoping that it is possible for the macro to RUN and hide/unhide purely on the change of value without the need to hit "enter"

Any help would be really appreciated :)
 
i finally got it....after crawling through a lot of forums i highjacked one that finally worked. I really dont know why the recommendations above didnt work *shrug*

Code:
Sub PG1()

    If Range("C14").Value = "No" Then
        Rows("15:15").EntireRow.Hidden = True
    ElseIf Range("c14").Value = "Yes" Then
        Rows("15:15").EntireRow.Hidden = False
    End If


End Sub


Private Sub Worksheet_Change(ByVal Target As Range)
    If Range("C14").Value = "No" Then
        Rows("15:15").EntireRow.Hidden = True
    ElseIf Range("C14").Value = "Yes" Then
        Rows("15:15").EntireRow.Hidden = False


    End If
End Sub
 
Upvote 0

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.

Forum statistics

Threads
1,216,105
Messages
6,128,859
Members
449,472
Latest member
ebc9

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