DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
Altın Üyelik Hakkında Bilgi
TextBox4 = [COLOR=red]Val[/COLOR](TextBox2) * [COLOR=red]Val[/COLOR](TextBox3)
TextBox4 = Cdbl(TextBox2) * Cdbl(TextBox3)
Amin cümlemize.Sayın Evren bey sizlere ve forumdaki diğer hocalarıma allah unutkanlık vermesin.
Elinize sağlık.Teşekkürler
Private Sub cmdKayit_Click()
Dim SATIR As Long
Dim BUL As Range
Sheets("Veri").Select
SATIR = Range("A65536").End(3).Row + 1
Cells(SATIR, 1) = SATIR - 1
If TextBox2 = Empty Then TextBox2 = 0
If TextBox3 = Empty Then TextBox3 = 0
If TextBox8 = Empty Then TextBox8 = 0
If TextBox9 = Empty Then TextBox9 = 0
TextBox4 = CDbl(TextBox2) * CDbl(TextBox3)
TextBox10 = CDbl(TextBox8) * CDbl(TextBox9)
Cells(SATIR, 2) = TextBox1.Text
Cells(SATIR, 3) = CDbl(TextBox2.Value)
Cells(SATIR, 4) = CDbl(TextBox3.Value)
Cells(SATIR, 5) = TextBox4.Value
Cells(SATIR, 6) = CDbl(TextBox8.Value)
Cells(SATIR, 7) = CDbl(TextBox9.Value)
Cells(SATIR, 8) = TextBox10.Value
With Sheets("Rapor")
Set BUL = .Range("B:B").Find(TextBox1.Text)
If Not BUL Is Nothing Then
.Cells(BUL.Row, "C") = WorksheetFunction.SumIf([Veri!B:B], .Cells(BUL.Row, "B"), [Veri!C:C])
.Cells(BUL.Row, "D") = WorksheetFunction.SumIf([Veri!B:B], .Cells(BUL.Row, "B"), [Veri!F:F])
.Cells(BUL.Row, "E") = .Cells(BUL.Row, "C") - .Cells(BUL.Row, "D")
Else
SATIR = .Cells(65536, 2).End(3).Row + 1
.Cells(SATIR, "B") = TextBox1.Text
.Cells(SATIR, "C") = WorksheetFunction.SumIf([Veri!B:B], .Cells(SATIR, "B"), [Veri!C:C])
.Cells(SATIR, "D") = WorksheetFunction.SumIf([Veri!B:B], .Cells(SATIR, "B"), [Veri!F:F])
.Cells(SATIR, "E") = .Cells(SATIR, "C") - .Cells(SATIR, "D")
End If
Set BUL = Nothing
End With
MsgBox "Kayıt İşlemi Tamamlandı."
End Sub
Selamlar,
Hataya sebep olan kısımları kontrol altına alarakta sorunu çözebilirsiniz.
Kaydet kodunu aşağıdaki şekilde değiştirip denermisiniz.
Korhan bey aşağıdaki kodlarla hatayı engellemiş.Merhabalar.
Sayın Korhan bey,ilgi ve yardımlarınıza teşekkürler.
Ben bu kodları denedim oldu elinize sağlık.Kafama şu cümle takıldı,"Hataya sebep olan kısımları kontrol altına alarakta sorunu çözebilirsiniz." Bunu nasıl yapacam.Teşekkürler.İyi çalışmalar.
If TextBox2 = Empty Then TextBox2 = 0
If TextBox3 = Empty Then TextBox3 = 0
If TextBox8 = Empty Then TextBox8 = 0
If TextBox9 = Empty Then TextBox9 = 0
O sizin harikalığınız.Sayın Evren Bey,tek kelime"Harikasınız"
Bayramınızı kutlar mutluluklar dilerim.İyi çalışmalar.