Private Class Amount Public TotalKingaku As Integer Public TotalZeigaku As Integer End Class ''' <summary> ''' 合計金額と合計消費税額を計算します。 ''' </summary> ''' <param name="table"></param> ''' <returns></returns> Private Function Summary(table As DataTable) As Amount Dim totalKingaku As Integer Dim totalZeigaku As Integer For Each row As DataRow In table.Rows totalKingaku += CInt(row.Item(1)) totalZeigaku += CInt(row.Item(2)) Next Dim result As New Amount result.TotalKingaku = totalKingaku result.TotalZeigaku = totalZeigaku Return result End Function