Confused0707
New Member
Hi All,
I have a problem and don't know how to sort it, hopefully someone can help me because I am losing my mind......
So, I have already two codes, but I need one more, I think...
When my file is protected then formulas that are in the certain range are hidden but when my file is unprotected then my formulas are visible..
I would like to put a code that will hide the formulas when the file is unprotected for the range from I4:BF153
I am really new in this and the codes that I have are taken from internet - when I need something I just google it
I needed a code for grouping ungrouping when file is protected so the below is the one that I used and the second one is I don't know for what anymore....
Please don't kill me.....
>>> use code - tags <<<
Hopefully someone can help me please......
Thanks!
I have a problem and don't know how to sort it, hopefully someone can help me because I am losing my mind......
So, I have already two codes, but I need one more, I think...
When my file is protected then formulas that are in the certain range are hidden but when my file is unprotected then my formulas are visible..
I would like to put a code that will hide the formulas when the file is unprotected for the range from I4:BF153
I am really new in this and the codes that I have are taken from internet - when I need something I just google it
I needed a code for grouping ungrouping when file is protected so the below is the one that I used and the second one is I don't know for what anymore....
Please don't kill me.....
>>> use code - tags <<<
Code:
Private Sub Workbook_Open()
Dim mySheet As Worksheet
Set mySheet = Application.ActiveSheet
Dim myPW As String
myPW = Application.InputBox("Type one Password to protect your worksheet:", "allowGroup", "", Type:=2)
mySheet.Protect Password:="Zero", userinterfaceonly:=True
mySheet.EnableOutlining = True
End Sub
Private Sub Workbook_Open()
Dim wsh As Worksheet
For Each wsh In Me.Worksheets
wsh.EnableOutlining = True
wsh.Protect Password:="Zero", userinterfaceonly:=True
Next wsh
End Sub
Hopefully someone can help me please......
Thanks!
Last edited by a moderator: