• DİKKAT

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

TextBox Sorunu

Katılım
8 Mart 2007
Mesajlar
582
Excel Vers. ve Dili
excel 2000 Türkçe
Merhaba arkadaşlar TextBox1 e küçük rakam girip ve TextBox2 ye KDV oranını yazdığım zaman hesaplama yapıyor. TextBox1 e büyük rakam yazdıktan sonra KDV oranına rakam girdiğim zaman hata veriyor.

Örneğin TextBox1 e 5.000 ve TextBox2 ye %18 yazdığım zaman Hesaplama yapıyor.


TextBox1 e 10.000 ve TextBox2 ye %18 yazdığım zaman hata veriyor.
Kod:
Private Sub TextBox1_Change()
deg1 = Replace(IIf(TextBox1 = "", 0, TextBox1), ".", ",")
deg2 = Replace(IIf(TextBox2 = "", 0, TextBox2), ".", ",")
TextBox3 = Format(Replace(CDbl(deg1) / (deg2 + 100) * CDbl(deg2), ".", ","), "#,##0.00")
End Sub

Private Sub TextBox5_Change()
deg1 = Replace(IIf(TextBox1 = "", 0, TextBox1), ".", ",")
TextBox5 = Format(Replace(CDbl(deg1), ".", ","), "#,##0.00")
End Sub

Private Sub TextBox3_Change()
deg1 = Replace(IIf(TextBox1 = "", 0, TextBox1), ".", ",")
deg2 = Replace(IIf(TextBox3 = "", 0, TextBox3), ".", ",")
TextBox4 = Format(Replace(CDbl(deg1) - CDbl(deg2), ".", ","), "#,##0.00")



End Sub
 
Son düzenleme:
aşağıdaki gibi deneyin

Kod:
Private Sub TextBox3_Change()
    If IsNumeric(TextBox1.Value) And IsNumeric(TextBox1.Value) Then
        Rakam = TextBox1.Value - TextBox3.Value
    End If
    deg1 = Replace(IIf(Rakam = "", 0, Rakam), ".", ",")
    TextBox4 = Format(Replace(Rakam, ".", ","), "#,##0.00")
End Sub
 
Son düzenleme:
Çok teşekkürler hocam ellerinize sağlık.
 
Geri
Üst