Unhide specific cells in a range

imageicb

Board Regular
Joined
Jan 13, 2012
Messages
66
Hello,

I have a range of cells that i named "hide" that are on a protected worksheet. All of these cells have formulas that I dont want to show up. I would like for the cells to become unhidden once a value is placed into them so that if a user has to go back and change something in that cell it will not erase what they type when they type it. Is there a way to accomplish this. Any help would be greatly appreciated. So far i have gotten this to run but it doesnt do anything.

Code:
Private Sub Worksheet_Change(ByVal Target As Range)()
Dim cell As Range
If Not Target.Range = "hide" Then Exit Sub

With ActiveSheet
        .Unprotect ("apple")

For Each cell In Range("hide")

cell.EntireRow.Hidden = False
Next cell
    .Protect ("apple"), DrawingObjects:=False, Contents:=True, Scenarios:=True _
        , AllowFormattingCells:=True
                
                            
    End With
End Sub

Thank You
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Try

Code:
If Intersect(Target, Range("hide")) Is Nothing Then Exit Sub
 
Upvote 0

Forum statistics

Threads
1,225,846
Messages
6,187,363
Members
453,420
Latest member
ESCH1021

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