• DİKKAT

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

Listbox da toplama

Katılım
31 Mayıs 2005
Mesajlar
92
Excel Vers. ve Dili
Excel 2019 Türkçe 64 bit
For i = 0 To ListBox1.ListCount - 1
t1 = CDbl(Val(ListBox1.List(i, 6))) + CDbl(Val(t1))
Next i
TextBox1.Value = Format(FormatNumber(t1, 6), "#,##0.00") * 1


Herkese iyi akşamlar.Yukardaki kodla Listbox1 de bulunan 7. sütunun alttoplamını Textbox1 aldırıyorum.Fakar toplam hatalı çıkıyor 333,47 çıkması gerekeni 303,00 olarak topluyor.Nerde hata yapıyor olabilir.Yardımcı olursanız sevinirim
 
Val kullanmayın.
Bunu daha önce ben defalarca forumda anlattım.
Kod aşağıdadır.:cool.
Kod:
Dim sayi As Double, t1 As Double
ListBox1.ColumnCount = 7
ListBox1.RowSource = "A1:K7"
For i = 0 To ListBox1.ListCount - 1
    If IsNumeric(ListBox1.List(i, 6)) Then
        sayi = ListBox1.List(i, 6)
        t1 = sayi + t1
        sayi = 0
    End If
Next i
TextBox1.Value = Format(t1, "#,##0.00")
 
Geri
Üst