G
grime
I have a form which fills cells I5:J24 with some default values. It
stores those values in cells N5:O24, which are hidden. When the user
changes a value from the default, the cells contents are bold. The
following script changes the cell contents back to the default value
when the user double clicks the cell:
Code:
--------------------
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
On Error GoTo errHandler
If Union(Range("$I$5:$J$24"), Target).Address = Range("$I$5:$J$24").Address Then
Application.ScreenUpdating = False
ActiveCell.Offset(0, 5).Range("A1").Copy
ActiveCell.Range("A1").PasteSpecial xlPasteValues
Application.CutCopyMode = False
ActiveCell.Offset(1, 0).Range("A1").Select
End If
errHandler:
Application.EnableEvents = True
Exit Sub
End Sub
--------------------
When I protect the sheet and workbook, I get the following error:
Function is not available on a protected worksheet
The strange thing is, when I comment out the entire code, I still get
the error.
Any thoughts or suggestions?
stores those values in cells N5:O24, which are hidden. When the user
changes a value from the default, the cells contents are bold. The
following script changes the cell contents back to the default value
when the user double clicks the cell:
Code:
--------------------
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
On Error GoTo errHandler
If Union(Range("$I$5:$J$24"), Target).Address = Range("$I$5:$J$24").Address Then
Application.ScreenUpdating = False
ActiveCell.Offset(0, 5).Range("A1").Copy
ActiveCell.Range("A1").PasteSpecial xlPasteValues
Application.CutCopyMode = False
ActiveCell.Offset(1, 0).Range("A1").Select
End If
errHandler:
Application.EnableEvents = True
Exit Sub
End Sub
--------------------
When I protect the sheet and workbook, I get the following error:
Function is not available on a protected worksheet
The strange thing is, when I comment out the entire code, I still get
the error.
Any thoughts or suggestions?