listboxta sutunları toplatma

ASMET67

Altın Üye
Katılım
8 Haziran 2007
Mesajlar
410
Excel Vers. ve Dili
Excel 2016
Altın Üyelik Bitiş Tarihi
30-11-2027
15 Sutundan oluşan listbox mesmem var ve aşağıdaki kodla 3 sutundan itibaren toplatmak istiyorum.
Kodlar 3 sutunu topru topluyor ondan sonra toplamıyor. Sutunda veri olmasına rağmen değer 0 görünmektedir.
Acil yardımlarınızı rica ederim.


HTML:
ListBox1.ColumnCount = 13
ListBox1.ColumnWidths = "50,150,50,50,50,50,50,50,150,50,50,50,50"
ListBox1.RowSource = "Gunluk_Giris!a9:m" & [Gunluk_Giris!a65536].End(3).Row
ListBox1.ColumnHeads = True
Dim i As Long
Dim toplam0 As Double, toplam1 As Double, toplam2 As Double, toplam3 As Double, toplam4 As Double, toplam5 As Double, toplam6 As Double
Dim toplam7 As Double, toplam8 As Double, toplam9 As Double, toplam10 As Double, toplam11 As Double, a As Double
Dim s As Long

toplam0 = 0
toplam1 = 0
toplam2 = 0
toplam3 = 0
toplam4 = 0
toplam5 = 0
toplam6 = 0
toplam7 = 0
toplam8 = 0
toplam9 = 0
toplam10 = 0
toplam11 = 0
Dim d As Long
d = ListBox1.ListCount
For i = 0 To d - 1
toplam0 = Val(ListBox1.List(i, 3)) + toplam0
toplam1 = Val(ListBox1.List(i, 4)) + toplam1
toplam2 = Val(ListBox1.List(i, 5)) + toplam2
toplam3 = Val(ListBox1.List(i, 6)) + Val(toplam3)
toplam4 = Val(ListBox1.List(i, 7)) + toplam4
toplam5 = Val(ListBox1.List(i, 8)) + toplam5
toplam6 = Val(ListBox1.List(i, 9)) + toplam6
toplam7 = Val(ListBox1.List(i, 10)) + toplam7
toplam8 = Val(ListBox1.List(i, 12)) + toplam8
'toplam9 = Val(ListBox1.List(i, 13)) + toplam9

Next i


t15.Value = Format(toplam0, "#,##0.00")
t16.Value = Format(toplam1, "#,##0.00" & " YTL")
t17.Value = Format(toplam2, "#,##0.00")
t18.Value = Format(toplam3, "#,##0.00" & " YTL")
t19.Value = toplam4
t20.Value = toplam5
t21.Value = toplam6
t22.Value = toplam7
t23.Value = toplam8
 
Katılım
15 Haziran 2006
Mesajlar
3,704
Excel Vers. ve Dili
Excel 2003, 2007, 2010 (TR)
Denedim ve bu kod bloğunda bir sorun yok. Başka olaylar ve prosedürler toplamı etkiliyor olabilir belki bilemiyorum. Textbox'ların change olayı veya kullandığınız başka bir şey...

Örnek dosya ekleyebilirseniz, daha açıklayıcı olacak galiba
 

ASMET67

Altın Üye
Katılım
8 Haziran 2007
Mesajlar
410
Excel Vers. ve Dili
Excel 2016
Altın Üyelik Bitiş Tarihi
30-11-2027
Tam sayıları topluyor ancak ondalik sauıları toplamıyor.
1,5 2,5 gibi
 
Katılım
15 Haziran 2006
Mesajlar
3,704
Excel Vers. ve Dili
Excel 2003, 2007, 2010 (TR)
Val fonksiyonunu kullanmadan, döngüde toplamları alın. Val, ondalık sayı döndürmez. Eğer sayıya döndürmede problemle karşılaşırsanız, 1 ile çarpın. Yani, Listbox1.List(i,3)*1 gibi....
 
Üst