Çözüldü Userformdan Sayfaya Kayıt

sirkülasyon

Altın Üye
Katılım
10 Temmuz 2012
Mesajlar
2,494
Excel Vers. ve Dili
2021 LTSC TR
Altın Üyelik Bitiş Tarihi
18-06-2026
Değerli Üstadım
Kod:
Dim sayfa As Worksheet
    Dim son As Long
    Set sayfa = ThisWorkbook.Sheets("Bordro")

    son = sayfa.Cells(sayfa.Rows.Count, "B").End(xlUp).row
On Error Resume Next
    With sayfa
        .Cells(son + 1, "C").Value = ComboBox1.Value
        .Cells(son + 1, "D").Value = ComboBox2.Value
        .Cells(son + 1, "E").Value = TextBox1.Value
        .Cells(son + 1, "F").Value = TextBox2.Value
        .Cells(son + 1, "G").Value = TextBox3.Value
        .Cells(son + 1, "H").Value = TextBox4.Value
        .Cells(son + 1, "I").Value = TextBox16.Value
        .Cells(son + 1, "J").Value = TextBox11.Value
        .Cells(son + 1, "K").Value = TextBox12.Value
        .Cells(son + 1, "L").Value = TextBox13.Value
        .Cells(son + 1, "M").Value = TextBox14.Value
        .Cells(son + 1, "N").Value = TextBox15.Value
        .Cells(son + 1, "O").Value = 1 * Format(TextBox17.Value, "#,##0.00")
        .Cells(son + 1, "P").Value = 1 * Format(TextBox18.Value, "#,##0.00")
        .Cells(son + 1, "Q").Value = 1 * Format(TextBox19.Value, "#,##0.00")
        .Cells(son + 1, "R").Value = 1 * Format(TextBox20.Value, "#,##0.00")
        .Cells(son + 1, "S").Value = 1 * Format(TextBox21.Value, "#,##0.00")
        .Cells(son + 1, "T").Value = 1 * Format(TextBox22.Value, "#,##0.00")
        .Cells(son + 1, "U").Value = 1 * Format(TextBox23.Value, "#,##0.00")
        .Cells(son + 1, "V").Value = 1 * Format(TextBox24.Value, "#,##0.00")
        .Cells(son + 1, "W").Value = 1 * Format(TextBox25.Value, "#,##0.00")
        .Cells(son + 1, "X").Value = 1 * Format(TextBox26.Value, "#,##0.00")
        .Cells(son + 1, "Y").Value = 1 * Format(TextBox27.Value, "#,##0.00")
        .Cells(son + 1, "Z").Value = 1 * Format(TextBox28.Value, "#,##0.00")
        .Cells(son + 1, "AA").Value = 1 * Format(TextBox29.Value, "#,##0.00")
        .Cells(son + 1, "AB").Value = 1 * Format(TextBox30.Value, "#,##0.00")
        .Cells(son + 1, "AC").Value = 1 * Format(TextBox31.Value, "#,##0.00")
        .Cells(son + 1, "AD").Value = 1 * Format(TextBox32.Value, "#,##0.00")
        .Cells(son + 1, "AE").Value = 1 * Format(TextBox33.Value, "#,##0.00")
    End With
Yukarıdaki kod ile yapamadığım bir işlem var. Sizlerden yardım rica ediyorum.
Yapamadığım kısım kaydın sadece 9. satır ile 40. satır arasında kayıt ettikçe alt alta kayıt yapması. 41 ve diğer satırlara kesinlikle geçmemesi.
Kod:
If son= 41 Then
        MsgBox "Limit Doldu. Kaydetme işlemi yapılamaz.", vbExclamation
    End If
kriteri de koydum ama bir anlam ifade etmedi. Yardımcı olabilir misiniz?
 

Hakan ERDOST

Destek Ekibi
Destek Ekibi
Katılım
12 Eylül 2004
Mesajlar
871
Excel Vers. ve Dili
Excel 2019 Türkçe (Ev)
Excel 2013 Türkçe (Okul)
Kod:
Dim sayfa As Worksheet
Dim son As Long
Set sayfa = ThisWorkbook.Sheets("Bordro")

son = sayfa.Cells(sayfa.Rows.Count, "B").End(xlUp).Row

If son >= 41 Then
    MsgBox "Limit Doldu. Kaydetme işlemi yapılamaz.", vbExclamation
Else
    On Error Resume Next
    With sayfa
        ' ... (mevcut kodunuz)
    End With
End If
 

sirkülasyon

Altın Üye
Katılım
10 Temmuz 2012
Mesajlar
2,494
Excel Vers. ve Dili
2021 LTSC TR
Altın Üyelik Bitiş Tarihi
18-06-2026
Teşekkür ederim
 
Üst