Sub Macro1()
Sheets("Sheet1").Select
Range("G1").Locked = False
Sheets("Sheet1").Protect
End Sub
Sub khoa() Dim a As String a = Sheet1.Range("G2").Value Sheet1.Range("G2").Locked = False Sheet1.Protect (a) End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean) Dim a As String a = Sheet1.Range("G2").Value Sheet1.Range("G2").Locked = False Sheet1.Protect (a) End Sub
Sheet1.Range("G2").Locked = False
If Sheet1.Range("G2").Locked = True Then Sheet1.Range("G2").Locked = False
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) .... End Sub
Sub khoa() Dim a, b As String a = Sheet1.Range("G2").Value b = Sheet1.Range("H2").Value Sheet1.Unprotect (b) Sheet1.Range("G2:H2").Locked = False Sheet1.Protect (a) Sheet1.Range("H2").Value = Sheet1.Range("G2").Value End Sub