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.
Ö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:
