A sütununa girilen isme göre o satırı komple kilitlemek istiyorum. Yalnız benim için en önemli ve olmazsa olmazım kilitlenen satırda değişiklik yapmaya çalıştığımda bana şifre sorsun ve doğru şifreyi girdiğimde o satırın kilidi açılsın istiyorum.
DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
Altın Üyelik Hakkında Bilgi
Private Sub Worksheet_Change(ByVal Target As Range)
sfr = 123
If Target.Address <> "$A$1" Then Exit Sub
If Target.Text = "ALİ" Then
Cells.Locked = False
Rows(2).Locked = True
ActiveSheet.Protect sfr
End If
End Sub
Private Sub CommandButton1_Click()
If TextBox1 = "ALİ" And TextBox2 = "1" Then
ActiveSheet.Unprotect "123"
Rows(1).Locked = False
ActiveSheet.Protect "123"
Unload Me
ElseIf TextBox1 = "VELİ" And TextBox2 = "2" Then
ActiveSheet.Unprotect "123"
Rows(2).Locked = False
ActiveSheet.Protect "123"
Unload Me
ElseIf TextBox1 = "MEHMET" And TextBox2 = "3" Then
ActiveSheet.Unprotect "123"
Rows(3).Locked = False
ActiveSheet.Protect "123"
Unload Me
End If
End Sub
Sub auto_open()
ActiveSheet.Unprotect "123"
Cells.Locked = True
ActiveSheet.Protect "123"
End Sub
Sub auto_CLOSE()
auto_open
End Sub
Sub calis()
auto_open
UserForm1.Show 0
End Sub
Private Sub Workbook_Open()
Application.OnKey "{F12}", "calis"
End Sub
Private Sub CommandButton1_Click()
If TextBox1 = "ALİ" And TextBox2 = "1" Then
ActiveSheet.Unprotect "123"
Range(TextBox3.Text).Locked = False
ActiveSheet.Protect "123"
Unload Me
ElseIf TextBox1 = "VELİ" And TextBox2 = "2" Then
ActiveSheet.Unprotect "123"
Range(TextBox3.Text).Locked = False
ActiveSheet.Protect "123"
Unload Me
ElseIf TextBox1 = "DELİ" And TextBox2 = "3" Then
ActiveSheet.Unprotect "123"
Range(TextBox3.Text).Locked = False
ActiveSheet.Protect "123"
Unload Me
End If
End Sub
Private Sub UserForm_Initialize()
TextBox3 = "a1:a3"
End Sub
Private Sub CommandButton1_Click()
If TextBox1 = "ALİ" And TextBox2 = "1" Then
ActiveSheet.Unprotect "123"
Cells.Locked = True
Rows(ActiveCell.Row).Locked = False
ActiveSheet.Protect "123"
Unload Me
ElseIf TextBox1 = "VELİ" And TextBox2 = "2" Then
ActiveSheet.Unprotect "123"
Cells.Locked = True
Rows(ActiveCell.Row).Locked = False
ActiveSheet.Protect "123"
Unload Me
ElseIf TextBox1 = "DELİ" And TextBox2 = "3" Then
ActiveSheet.Unprotect "123"
Cells.Locked = True
Rows(ActiveCell.Row).Locked = False
ActiveSheet.Protect "123"
Unload Me
End If
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column <> 1 Then Exit Sub
UserForm1.Show 0
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Column <> 1 Then Exit Sub
If Target.Count > 1 Then Exit Sub
If Target = Empty Then
ActiveSheet.Unprotect "123"
Cells.Locked = True
Rows(Target.Row).Locked = False
ActiveSheet.Protect "123"
Else
UserForm1.Show 0
UserForm1.TextBox1 = Cells(Target.Row, 1)
End If
End Sub
Sub auto_open()
ActiveSheet.Unprotect "123"
Cells.Locked = True
ActiveSheet.Protect "123"
End Sub
Sub auto_CLOSE()
auto_open
End Sub
Sub calis()
auto_open
UserForm1.Show 0
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column <> 1 Then Exit Sub
If Target.Count > 1 Then Exit Sub
If Target.Locked = False Then Exit Sub
If Target = Empty Then
ActiveSheet.Unprotect "123"
Cells.Locked = True
Rows(Target.Row).Locked = False
ActiveSheet.Protect "123"
Else
UserForm1.Show 0
UserForm1.TextBox1 = Cells(Target.Row, 1)
End If
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Column <> 1 Then Exit Sub
If Target.Count > 1 Then Exit Sub
If Target.Locked = False Then Exit Sub
If Target = Empty Then
ActiveSheet.Unprotect "123"
Cells.Locked = True
Rows(Target.Row).Locked = False
ActiveSheet.Protect "123"
Else
UserForm1.Show 0
UserForm1.TextBox1 = Cells(Target.Row, 1)
End If
End Sub
Private Sub Workbook_Open()
Application.OnKey "{F12}", "calis"
End Sub
Private Sub CommandButton1_Click()
If CheckBox1 Then SatirAc TextBox1.Text: Exit Sub
If CheckBox2 Then SatirKapat: Exit Sub
If TextBox1 = "ALİ" And TextBox2 = "1" Then
ActiveSheet.Unprotect "123"
Cells.Locked = True
Rows(ActiveCell.Row).Locked = False
ActiveSheet.Protect "123"
Unload Me
ElseIf TextBox1 = "VELİ" And TextBox2 = "2" Then
ActiveSheet.Unprotect "123"
Cells.Locked = True
Rows(ActiveCell.Row).Locked = False
ActiveSheet.Protect "123"
Unload Me
ElseIf TextBox1 = "DELİ" And TextBox2 = "3" Then
ActiveSheet.Unprotect "123"
Cells.Locked = True
Rows(ActiveCell.Row).Locked = False
ActiveSheet.Protect "123"
Unload Me
End If
End Sub
Private Sub SatirAc(Isim)
ActiveSheet.Unprotect "123"
Cells.Locked = True
For i = 1 To [a65536].End(3).Row
If Isim = Cells(i, 1) Then Rows(i).Locked = False
Next
ActiveSheet.Protect "123"
MsgBox "Satırlar Açılmıştır."
Unload Me
End Sub
Private Sub SatirKapat()
ActiveSheet.Unprotect "123"
Cells.Locked = True
ActiveSheet.Protect "123"
MsgBox "Satırlar Kapatılmıştır."
Unload Me
End Sub
Private Sub CommandButton1_Click()
If TextBox1 = "ALİ" And TextBox2 = "1" Then
If CheckBox1 Then SatirAc TextBox1.Text: Exit Sub
If CheckBox2 Then SatirKapat: Exit Sub
ActiveSheet.Unprotect "123"
Cells.Locked = True
Rows(ActiveCell.Row).Locked = False
ActiveSheet.Protect "123"
Unload Me
ElseIf TextBox1 = "VELİ" And TextBox2 = "2" Then
If CheckBox1 Then SatirAc TextBox1.Text: Exit Sub
If CheckBox2 Then SatirKapat: Exit Sub
ActiveSheet.Unprotect "123"
Cells.Locked = True
Rows(ActiveCell.Row).Locked = False
ActiveSheet.Protect "123"
Unload Me
ElseIf TextBox1 = "DELİ" And TextBox2 = "3" Then
If CheckBox1 Then SatirAc TextBox1.Text: Exit Sub
If CheckBox2 Then SatirKapat: Exit Sub
ActiveSheet.Unprotect "123"
Cells.Locked = True
Rows(ActiveCell.Row).Locked = False
ActiveSheet.Protect "123"
Unload Me
Else
MsgBox "Hatalı Kullanıcı Yada Şifre": Unload Me
End If
End Sub