- Katılım
- 15 Mart 2005
- Mesajlar
- 43,385
- Excel Vers. ve Dili
- Microsoft 365 Tr-En 64 Bit
Bu şekilde deneyiniz.
Küsüratlı sayılarda yuvarlama yapmak sorunu çözebilir.
	
	
	
		
								Küsüratlı sayılarda yuvarlama yapmak sorunu çözebilir.
		C++:
	
	Option Explicit
Sub ToplamAl()
    Dim Veri As Variant, X As Long, Say As Long, Son As Long
    Son = Sheets("sayfa1").Cells(Rows.Count, 1).End(3).Row
    If Son < 3 Then Son = 3
    
    Veri = Range("A2:B" & Son).Value2
    
    ListBox1.Clear
    
    ReDim Liste(1 To 2, 1 To 1)
    
    With VBA.CreateObject("Scripting.Dictionary")
        For X = LBound(Veri, 1) To UBound(Veri, 1)
            If Not .Exists(Veri(X, 1)) Then
                Say = Say + 1
                .Add Veri(X, 1), Say
                ReDim Preserve Liste(1 To 2, 1 To Say)
                Liste(1, Say) = Veri(X, 1)
                Liste(2, Say) = VBA.Format(VBA.Round(Veri(X, 2), 2), "#,##0.00")
            Else
                Liste(2, .Item(Veri(X, 1))) = VBA.Format(VBA.Round(Liste(2, .Item(Veri(X, 1))) + Veri(X, 2), 2), "#,##0.00")
            End If
        Next
    End With
    
    ListBox1.ColumnCount = 2
    ListBox1.Column = Liste
End Sub 
				





 
 
		 
 
		