I have been trying lots of things i found on youtube but either it wont unlock or relock....
This is in workbook. I have tried more then one page(,"Installs","Crystal") but it errors out.
i have also placed the following in the pages. but if leaves it unlocked after clicking macro button. It also will not run macro if i lock it at end of each sub.
This is in workbook. I have tried more then one page(,"Installs","Crystal") but it errors out.
VBA Code:
Private Sub Workbook_Open()
Call AllowMacroWhenProtected
End Sub
Sub AllowMacroWhenProtected()
Sheets("Master Quote DO NOT TOUCH").Protect Password:="7712", _
UserInterfaceOnly:=True
End Sub
i have also placed the following in the pages. but if leaves it unlocked after clicking macro button. It also will not run macro if i lock it at end of each sub.
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
ThisWorkbook.Worksheets("Install Quote").Unprotect ("7712")
With Application
Num = .Match(Range("AW14").Value, Split("one,two,three,four,five,six,seven,eight,nine,ten,eleven,twelve,thirteen,fourteen,fifteen,sixteen,seventeen,eighteen,nineteen,twenty", ","), 0)
End With
Rows("27:287").Hidden = False
If IsNumeric(Num) Then Rows(Num * 13 + 14 & ":287").Hidden = True
End Sub
Sub NewDropDownDefault()
ThisWorkbook.Worksheets("Install Quote").Unprotect ("7712")
Range("N8").ClearContents
Dim Rng As Range
Application.ScreenUpdating = False
On Error Resume Next
Set Rng = ActiveSheet.UsedRange.SpecialCells(xlCellTypeAllValidation)
Rng.Value = "'- Choose Option -"
On Error GoTo 0
ThisWorkbook.Worksheets("Install Quote").Protect ("7712")
End Sub
Private Sub Workbook_Open()
Call AllowMacroWhenProtected
End Sub
Sub AllowMacroWhenProtected()
Sheets("Install Quote").Protect Password:="7712", _
UserInterfaceOnly:=True
End Sub