Soru Textbox işlem hatası

sirkülasyon

Altın Üye
Katılım
10 Temmuz 2012
Mesajlar
2,547
Excel Vers. ve Dili
2021 LTSC TR
Kod:
Private Sub TextBox25_Change()
If TextBox25.Value < 22 And TextBox25.Value > 0 Then
TextBox26.Value = Replace(FormatNumber(CDbl(TextBox22.Value) * CDbl(TextBox25.Value), 2), ".", ",")
TextBox27.Value = Replace(FormatNumber(CDbl(TextBox23.Value) * CDbl(TextBox25.Value), 2), ".", ",")
TextBox28.Value = Replace(FormatNumber(CDbl(TextBox26.Value) + CDbl(TextBox27.Value), 2), ".", ",")
Else
TextBox26.Value = ""
TextBox27.Value = ""
TextBox28.Value = ""
MsgBox "Çalışma Yapılan Gün Sayısını Girmediniz", vbOKOnyl + vbInformation, "   BİLGİ !"
End If
End Sub
Ustam TextBox25' e tek hane (1 - 9 Arası ) rakam girdiğim zaman matematiksel işlem yapıyor.
10 - 22 arası rakam girdiğim zaman hata veriyor. Rica etsem yardımcı olabilir misiniz?
 
Merhaba,

Aşağıdaki gibi kullanıp sonucu söyler misiniz.

Kod:
Private Sub TextBox25_AfterUpdate()

    If CDbl(TextBox25.Value) < 22 And CDbl(TextBox25.Value) > 0 Then
        Kodlarınız
    Else
        Kodlarınız
    End If
 
Deneyiniz.
Kod:
TextBox26.Value =Format(CDbl(TextBox22.Value) * CDbl(TextBox25.Value),"#,##0.00")
Yinede hata verirse textbox22 yada textbox25 içinde sayı bulunmaktadır,yada en az birisinin içi boştur.
 
Private Sub TextBox25_AfterUpdate()
If CDbl(TextBox25.Value) < 22 And CDbl(TextBox25.Value) > 0 Then
TextBox26.Value = Format(CDbl(TextBox22.Value) * CDbl(TextBox25.Value),"#,##0.00")
TextBox27.Value =Format(CDbl(TextBox23.Value) * CDbl(TextBox25.Value),"#,##0.00")
TextBox28.Value = Format(CDbl(TextBox26.Value) + CDbl(TextBox27.Value),"#,##0.00")
Else
TextBox26.Value = ""
TextBox27.Value = ""
TextBox28.Value = ""
MsgBox "Çalışma Yapılan Gün Sayısını Girmediniz", vbOKOnyl + vbInformation, " BİLGİ !"
End If
End Sub
şekli ile 2 karaktere izin verdi ve matematik işlemlerini yaptı.
Necdet Abime ve Evren Abime Teşekkür ederim.
 
Geri
Üst