• DİKKAT

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

Sütundaki En Son Boş Hücreye Kayıt

Katılım
5 Kasım 2007
Mesajlar
4,727
Excel Vers. ve Dili
64 Bit TR - Microsoft Office 365 - Win11 Home
Merhaba,

Aşağıdaki Kod'a ilave yaparak, TextBox8 deki Ad ve Soyadı kaydının,

"ÜYE_AİDAT_LİSTESİ" sayfası "B" sütunundaki en son boş hücreye de yapılmasını, istiyorum.

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İ")
[COLOR="Red"]Set s3 = Sheets("ÜYE_AİDAT_LİSTESİ")[/COLOR]

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 [COLOR="Green"]'Ad ve Soyad[/COLOR]
...........................................
...........................................

s2.Cells(b, 1) = TextBox7.Value  
s2.Cells(b, 2) = TextBox8.Value  [COLOR="green"]'Ad ve Soyad[/COLOR]
...........................................
...........................................

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

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

UserForm_Initialize
ThisWorkbook.Save
Application.DisplayAlerts = True

End Sub

Teşekkür ederim.
 
Aşağıdaki gibi denermisiniz.

Kod:
Private Sub CommandButton1_Click()
Application.DisplayAlerts = False
Dim s1, s2,[COLOR="Red"]s3[/COLOR] 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,[COLOR="Red"]c[/COLOR] As Long
a = s1.Range("A" & Rows.Count).End(xlUp).Row + 1
b = s2.Range("A" & Rows.Count).End(xlUp).Row + 1
[COLOR="Red"]c = s3.Range("B" & Rows.Count).End(xlUp).Row + 1[/COLOR]
s1.Select

s1.Cells(a, 1) = TextBox7.Value 
s1.Cells(a, 2) = TextBox8.Value 'Ad ve Soyad
...........................................
...........................................

s2.Cells(b, 1) = TextBox7.Value  
s2.Cells(b, 2) = TextBox8.Value  'Ad ve Soyad
...........................................
...........................................
[COLOR="Red"]s3.Cells(c, 2) = TextBox8.Value  'Ad ve Soyad[/COLOR]

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

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

UserForm_Initialize
ThisWorkbook.Save
Application.DisplayAlerts = True

End Sub
 
Sayın yanginci34 merhaba,

Çözüm ve duyarlığınız için teşekkür ederim, sağ olun.

Saygılarımla.
 
Rica ederim dönüş yaptığınız için ben teşekkür ederim sizde sağ olun iyi akşamlar.
 
Geri
Üst