Public Class frmVorauskasse_ZollBerechnen
    Public GesamtBetrag As Double = 0



    Private Sub MyDatagridview1_CellValueChanged(sender As Object, e As DataGridViewCellEventArgs) Handles MyDatagridview1.CellValueChanged
        If e.ColumnIndex = 2 Then Exit Sub
        GesamtBetrag = 0
        For Each r As DataGridViewRow In MyDatagridview1.Rows
            If Not r.IsNewRow Then
                If IsNumeric(r.Cells(0).Value) And IsNumeric(r.Cells(1).Value) Then
                    Dim Zoll = CDbl(r.Cells(0).Value) * (CDbl(r.Cells(1).Value) / 100)
                    Zoll = CDbl(Zoll.ToString("C2")) ' RUNDUNG
                    r.Cells(2).Value = Zoll
                    GesamtBetrag += Zoll
                Else
                    r.Cells(2).Value = ""
                End If
            End If
        Next
        Label1.Text = GesamtBetrag.ToString("C2")
    End Sub

    Private Sub frmVorauskasse_ZollBerechnen_Load(sender As Object, e As EventArgs) Handles Me.Shown
        With MyDatagridview1
            .Columns(0).DefaultCellStyle.Format = "N2"
            .Columns(1).DefaultCellStyle.Format = "N2"
        End With
    End Sub

End Class