• DİKKAT

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

Soru boş satırı dolu görerek kayıt yapmaması

sirkülasyon

Altın Üye
Katılım
10 Temmuz 2012
Mesajlar
2,543
Excel Vers. ve Dili
2021 LTSC TR
Kod:
Private Sub CommandButton7_Click()
Dim sat As Long
If Empty = TextBox4 Then
MsgBox "TextBox4 değer girilmediği için işleminiz iptal edildi.", vbCritical
Exit Sub
   End If
 If Empty = TextBox5 Then
MsgBox "TextBox5 değer girilmediği için işleminiz iptal edildi.", vbCritical
Exit Sub
   End If
If Empty = TextBox6 Then
MsgBox "TextBox6 değer girilmediği için işleminiz iptal edildi.", vbCritical
Exit Sub
   End If
With Sheets("bordro")
    sat = .Cells(65536, "A").End(xlUp).Row + 1
  If sat > 31 Then
    MsgBox "Satır doldu kayıt yapılmadı..!!", vbCritical, "UYARI"
  Exit Sub
    End If
    .Cells(sat, "a").Value = TextBox2.Text
    .Cells(sat, "b").Value = TextBox1.Text
    .Cells(sat, "c").Value = TextBox3.Text
    .Cells(sat, "d").Value = TextBox5.Text
    .Cells(sat, "e").Value = TextBox4.Text
    .Cells(sat, "f").Value = TextBox6.Text
    .Cells(sat, "g").Value = Round(.Cells(sat, "d").Value * .Cells(sat, "e").Value * .Cells(sat, "f").Value, 2)
    .Cells(sat, "h").Value = Round(.Cells(sat, "g").Value * 0.0066, 2)
    .Cells(sat, "ı").Value = Round(.Cells(sat, "g").Value * 0.0066, 2)
    .Cells(sat, "j").Value = Round(.Cells(sat, "g").Value - .Cells(sat, "ı").Value, 2)
    MsgBox "KAYIT AKTARILDI", , "DESTEK"
    For d = [b65536].End(3).Row To 1 Step -1
If WorksheetFunction.CountIf(Range("b5:b" & d), Cells(d, "b")) > 1 Then Rows(d).Delete
Next
MsgBox " Çift TC KİMLİK kaydı bulundu ve son girişiniz iptal edildi.", vbCritical, "MÜKERRER"
End With
Unload Me
End Sub


5 ve 31 satır arasına kayıt yapmasını 31 den büyükse satır dolu görüp kayıt yapmamasını istiyorum. Ancak boş satır olmasına rağmen "satır doldu" uyarısı ile kaydı engelliyor.

Nasıl düzeltebilirim?
 
Merhaba;

With Sheets("bordro")
satırından önce;
sat=5
başlangıç değerini belirleyin.
sat = .Cells(65536, "A").End(xlUp).Row + 1
satırını silin
.Cells(sat, "j").Value = Round(.Cells(sat, "g").Value - .Cells(sat, "ı").Value, 2)
satırından sonra;
sat=sat+1
yazın ve deneyin.
(Örnek dosyanız olmadan ancak bu kadar...)
İyi çalışmalar.
 
Muygun üstadım
Kayıt tamam ancak sadece 5. satırda kayıt yapıyor.
Kaydet dedikçe sadece beşinci satırda eskiyi siliyor yeniyi kayıt ediyor. Alt alta kayıt yapmıyor
 
sat = .Cells(65536, "A").End(xlUp).Row + 1

satırını sildiniz mi?
 
muygun üstadım
Hakkını helal et.
Sağ Olasın
 
Geri
Üst