Sub test1()
Application.ScreenUpdating = False
Application.EnableEvents = False
Dim cells As Range
Dim workingsheet As Worksheet
Set workingsheet = Worksheets("Sheet1")
Set cells = workingsheet.Range("G5")
Sheets("Sheet1").Activate
Range("G1").Select
If ActiveCell.Value = "A" Then
workingsheet.Unprotect Password:="0000"
cells.Locked = False
cells.Value = "Got it"
workingsheet.Protect Password:="0000"
Else
End If
Application.ScreenUpdating = True
Application.EnableEvents = True
End Sub
Application.ScreenUpdating = False
Application.EnableEvents = False
Dim cells As Range
Dim workingsheet As Worksheet
Set workingsheet = Worksheets("Sheet1")
Set cells = workingsheet.Range("G5")
Sheets("Sheet1").Activate
Range("G1").Select
If ActiveCell.Value = "A" Then
workingsheet.Unprotect Password:="0000"
cells.Locked = False
cells.Value = "Got it"
workingsheet.Protect Password:="0000"
Else
End If
Application.ScreenUpdating = True
Application.EnableEvents = True
End Sub
No comments:
Post a Comment