"Unhide/Hide Multiple Rows if Cell = Value/No Value" Question

MattyTBR

New Member
Joined
Dec 28, 2010
Messages
8
Hello experts!

I have another question for you...

I'm trying to hide rows 175 through 278 if cell C63 does NOT equal any number value, and unhide rows 175 through 278 if cell C63 DOES equal any number value. I know I need a macro for this, and I need the macro to run if that cell value ever changes (rather than clicking a button to make the macro do its thing.)

I've tried to look for VBA code that would do something like this, and maybe it's just my lack of VBA coding knowledge, but I can't seem to make them work.

If any of you have any suggestions or advice, I'd love to hear from you.

Thank you very much in advance!

-Matty
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Hi,

Maybe this

Copy the macro below to the code-page of your worksheet
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    If Not Intersect(Target, Range("C63")) Is Nothing Then
        If Not IsNumeric(Range("C63").Value) Or Range("C63").Value = "" Then
            Range("A175:A278").EntireRow.Hidden = True
        Else
            Range("A175:A278").EntireRow.Hidden = False
        End If
    End If
    
End Sub

HTH

M.
 
Upvote 0

Forum statistics

Threads
1,224,551
Messages
6,179,480
Members
452,915
Latest member
hannnahheileen

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