- Katılım
- 5 Kasım 2007
- Mesajlar
- 4,727
- Excel Vers. ve Dili
- 64 Bit TR - Microsoft Office 365 - Win11 Home
Merhaba,
UserForm'da, çalıştığım KOD aşağıdadır,
İstenen,
TextBox18 ve TextBox10'a tarih girildiğinde ;
TextBox11'in (Yaşı) otomatik hesaplanması,
UserForm'a kayıtta, önce TextBox10'a (Doğum Tarihi) , sonrasında TextBox18'e (Kayıt Tarihi) tarih girilmektedir.
Şöyle bir şey denedim, ya yanlış ve/veya eksik kodladım, yada yanlış yere ekledim,
'TextBox11.Text = (TextBox18.Text - TextBox10.Text)
Teşekkür ederim.
UserForm'da, çalıştığım KOD aşağıdadır,
İstenen,
TextBox18 ve TextBox10'a tarih girildiğinde ;
TextBox11'in (Yaşı) otomatik hesaplanması,
UserForm'a kayıtta, önce TextBox10'a (Doğum Tarihi) , sonrasında TextBox18'e (Kayıt Tarihi) tarih girilmektedir.
Şöyle bir şey denedim, ya yanlış ve/veya eksik kodladım, yada yanlış yere ekledim,
'TextBox11.Text = (TextBox18.Text - TextBox10.Text)
Kod:
Private Sub CommandButton1_Click()
Application.DisplayAlerts = False
Dim s1, s2,s3 As Worksheet
Set s1 = Sheets("KAYITLI_ÜYE_LİSTESİ")
Set s2 = Sheets("ÜYE_KAYIT_YEDEKLERİ")
Set s3 = Sheets("ÜYE_AİDAT_LİSTESİ")
Dim a, b,c As Long
a = s1.Range("A" & Rows.Count).End(xlUp).Row + 1
b = s2.Range("A" & Rows.Count).End(xlUp).Row + 1
c = s3.Range("B" & Rows.Count).End(xlUp).Row + 1
s1.Select
S1.Unprotect "123456789"
s2.Unprotect "123456789"
s1.Cells(a, 1) = TextBox7.Value
s1.Cells(a, 2) = TextBox8.Value
...........................................
S1.Cells(a, 4) = TextBox10.Value 'Doğum Tarihi
S1.Cells(a, 5) = TextBox11.Value 'Yaşı
...........................................
S1.Cells(a, 13) = TextBox18.Value 'Kayıt Tarihi
s2.Cells(b, 1) = TextBox7.Value
s2.Cells(b, 2) = TextBox8.Value
...........................................
...........................................
s1.Protect "123456789"
s2.Protect "123456789"
s3.Cells(c, 2) = TextBox8.Value
MsgBox "Verileriniz Kaydedildi. Form boşaltılıyor "
TextBox8 = ""
TextBox9 = ""
..........................................
..........................................
UserForm_Initialize
ThisWorkbook.Save
Application.DisplayAlerts = True
End Sub
Teşekkür ederim.
