AW: Auswertung mehrerer Reihen
09.09.2005 20:48:31
iven_s
Hallo Frank,
habe den Code soweit angepasst. Schau mal ob es deinen Anforderungen genügt.
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Summe As Double
dim i as Integer
Dim iMax As Integer
Dim j As Integer
Dim jMax As Integer
Dim a As Integer
Dim iMax2 As Integer
Dim jMax2 As Integer
iMax = Sheets(1).Cells(65536, 1).End(xlUp).Row
jMax = Sheets(1).Cells(8, 256).End(xlToLeft).Column
iMax2 = Sheets(2).Cells(65536, 2).End(xlUp).Row
jMax2 = Sheets(2).Cells(5, 256).End(xlToLeft).Column
a = 0
Summe = 0
If Target.Address = Range("A5").Address Then
Range(Sheets(2).Cells(5, 2), Sheets(2).Cells(iMax2, jMax2)).ClearContents
For i = 8 To iMax
If Sheets(1).Cells(i, 1).Value = Sheets(2).Cells(5, 1).Value Then
For j = 2 To jMax
Sheets(2).Cells(5 + a, j).Value = Sheets(1).Cells(i, j).Value
Next j
Summe = Summe + Sheets(1).Cells(i, 3).Value
a = a + 1
End If
Next i
Sheets(2).Cells(5 + a, 3).Value = Summe
Sheets(2).Cells(5 + a, 2).Value = "Summe"
End If
End Sub
Gruß iven_s