Merhaba arkadaşlar aşağıdaki koda “Z1:Z100” aralığındaki herhangi bir hücrede “A” yazıyor ise çalışsın boş ise çalışmasını nasıl yapabilirim. Başka öneriniz olursa oda olur. Benim yapmak istediğim Z1 dolu ise A1:K1 hücre aralığını koruma altına almak daha sonra Z1 boş olduğunda A1:K1 hücre aralığındaki korumanın kaldırılması.
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, [A1:A100]) Is Nothing Then Exit Sub
ActiveSheet.Unprotect "a"
If Target.Value <> "" Then
Range(Cells(Target.Row, 1), Cells(Target.Row, 11)).Locked = True
End If
ActiveSheet.Protect "a"
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, [A1:A100]) Is Nothing Then Exit Sub
ActiveSheet.Unprotect "a"
If Target.Value <> "" Then
Range(Cells(Target.Row, 1), Cells(Target.Row, 11)).Locked = True
End If
ActiveSheet.Protect "a"
End Sub
