السلام عليكم
=======
هذا الكود
Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
Dim rFormulaCheck As Range
On Error Resume Next
Sh.Unprotect Password:="Secret"
With Selection
.Locked = False
.FormulaHidden = False
End With
If Target.Cells.Count = 1 Then
If Target.HasFormula Then
With Target
.Locked = True
.FormulaHidden = True
End With
Sh.Protect Password:="Secret", UserInterFaceOnly:=True
End If
ElseIf Target.Cells.Count > 1 Then
Set rFormulaCheck = Selection.SpecialCells(xlCellTypeFormulas)
If Not rFormulaCheck Is Nothing Then
With Selection.SpecialCells(xlCellTypeFormulas)
.Locked = True
.FormulaHidden = True
End With
Sh.Protect Password:="Secret", UserInterFaceOnly:=True
End If
End If
On Error GoTo 0
End Sub
يقوم باخفاء المعادلات فى اى صفحة اتوماتيكيا بعد الكتابة مباشرة دون تدخل من المستخدم
كلمة فك الحماية مثلا ستكون Secret
hh.rar