AW: Zellen auslesen
22.01.2010 13:05:00
welga
Hallo,
versuch mal:
Sub testing()
Dim i As Long
Dim a As Long
Dim b As Boolean
Dim c As Boolean
For i = Sheets(1).UsedRange.Rows.Count To 4 Step -1
b = False
c = True
If Cells(i, 19).Value "" And IsNumeric(Cells(i, 20)) And Cells(i, 16) = "" Then
If Cells(i, 19).Value = Cells(i - 1, 19).Value Then
If Cells(i - 1, 16).Value "" Then b = True
If b Then
a = 1
If Cells(i, 19).Value Cells(i - 1 - a, 19).Value Then c = False
b = False
Else
a = 0
End If
If c Then Cells(i - 1 - a, 11).Value = Cells(i - 1 - a, 11).Value + Cells(i, 11).Value
If c Then Cells(i, 11).ClearContents
If c Then Cells(i, 8).ClearContents
If c Then Cells(i, 14).ClearContents
If c Then Cells(i - 1 - a, 14).Value = Cells(i - 1 - a, 8).Value * Cells(i - 1 - a, 11).Value
End If
End If
If Cells(i, 16) "" Then
Cells(i, 11).ClearContents
Cells(i, 8).ClearContents
Cells(i, 14).ClearContents
End If
Next i
End Sub
Gruß
welga