• DİKKAT

    DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
    Altın Üyelik Hakkında Bilgi

Korumalı Sayfaya Kayıt

  • Konbuyu başlatan Konbuyu başlatan 1Al2Ver
  • Başlangıç tarihi Başlangıç tarihi
Katılım
5 Kasım 2007
Mesajlar
4,727
Excel Vers. ve Dili
64 Bit TR - Microsoft Office 365 - Win11 Home
Merhaba,

UserForm aracılığı ile sayfalara kayıt yapıyorum,

"KAYITLI_ÜYE_LİSTESİ" ve "ÜYE_KAYIT_YEDEKLERİ" sayfalarına, sayfa koruma koymak ve kayıtı böyle yapmak istiyorum.

Sayfa şifreleri 12345 olabilir.

Teşekkür ederim.

Kod:
Private Sub CommandButton1_Click()
Application.DisplayAlerts = False
Dim s1, s2 As Worksheet
Set s1 = Sheets("KAYITLI_ÜYE_LİSTESİ")
Set s2 = Sheets("ÜYE_KAYIT_YEDEKLERİ")
Dim a, b As Long
a = s1.Range("A" & Rows.Count).End(xlUp).Row + 1
b = s2.Range("A" & Rows.Count).End(xlUp).Row + 1
s1.Select

s1.Cells(a, 1) = TextBox7.Value 
s1.Cells(a, 2) = TextBox8.Value 
...........................................
...........................................

s2.Cells(b, 1) = TextBox7.Value  
s2.Cells(b, 2) = TextBox8.Value  
...........................................
...........................................

MsgBox "Verileriniz Kaydedildi. Form boşaltılıyor "

TextBox8 = "" 
TextBox9 = "" 
..........................................
..........................................

UserForm_Initialize
ThisWorkbook.Save
Application.DisplayAlerts = True

End Sub
 
Buyurun.:cool:
Kod:
Private Sub CommandButton1_Click()
Application.DisplayAlerts = False
Dim s1, s2 As Worksheet
Set s1 = Sheets("KAYITLI_ÜYE_LİSTESİ")
Set s2 = Sheets("ÜYE_KAYIT_YEDEKLERİ")
Dim a, b As Long
a = s1.Range("A" & Rows.Count).End(xlUp).Row + 1
b = s2.Range("A" & Rows.Count).End(xlUp).Row + 1
s1.Select
[B][COLOR="red"]s1.Unprotect "12345"[/COLOR][/B]
[B][COLOR="red"]s2.Unprotect "12345"[/COLOR][/B]
s1.Cells(a, 1) = TextBox7.Value
s1.Cells(a, 2) = TextBox8.Value
...........................................
...........................................

s2.Cells(b, 1) = TextBox7.Value
s2.Cells(b, 2) = TextBox8.Value
...........................................
...........................................
[B][COLOR="Red"]s1.Protect "12345"[/COLOR][/B]
[B][COLOR="red"]s2.Protect "12345"[/COLOR][/B]
MsgBox "Verileriniz Kaydedildi. Form boşaltılıyor "

TextBox8 = ""
TextBox9 = ""
..........................................
..........................................

UserForm_Initialize
ThisWorkbook.Save
Application.DisplayAlerts = True

End Sub
 
Sayın Orion1 merhaba,

Çok teşekkür ederim, sağ olun.

Saygılarımla.
 
Geri
Üst