I am using code to add a double line that requires me to set the same password as the password to protect the sheet. And I don't want someone to be able to view the code on my protected sheet. How do I do this?
Also, I don't want to hide the sheet, just protect it.
Here is the code, if needed.
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Me.Unprotect "password"
Cancel = True
Target.Offset(1).EntireRow.Insert
Target.EntireRow.Copy Target.Offset(1).EntireRow
On Error Resume Next
Target.Offset(1).EntireRow.SpecialCells(xlConstants).ClearContents
Me.Protect "password"
End Sub
Also, I don't want to hide the sheet, just protect it.
Here is the code, if needed.
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Me.Unprotect "password"
Cancel = True
Target.Offset(1).EntireRow.Insert
Target.EntireRow.Copy Target.Offset(1).EntireRow
On Error Resume Next
Target.Offset(1).EntireRow.SpecialCells(xlConstants).ClearContents
Me.Protect "password"
End Sub