zelleninhalte löschen funktioniert nicht
05.03.2006 21:56:16
selo
stehe wiedermal vor einem problem
habe folgenden code
Sub selo_berechnung1()
Worksheets("gesamtplanung").Activate
With ActiveSheet
Dim loLetzte As Long
Dim loI As Long
Dim ZeileEnde, SpalteEnde, y, x, zelle
loLetzte = IIf(IsEmpty(Cells(Rows.Count, 2)), Cells(Rows.Count, 2).End(xlUp).Row, Rows.Count)
For loI = 2 To loLetzte
ZeileEnde = loI 'letzte Zeile = loI
SpalteEnde = 15 'letzte Spalte = o
For y = 14 To SpalteEnde 'Bereich ab Spalte n bis o
For x = 2 To ZeileEnde 'Bereich ab Zeile 2 bis letzte
Cells(x, y).Select
zelle = ActiveCell.Formula
If Left(zelle, 1) <> "=" Then Cells(x, y).ClearContents
Next x
Next y
Cells(loI, 14).FormulaLocal = "hier erfolgt ein berechnungsschritt"
Cells(loI, 14).NumberFormat = "General"
Range(Cells(loI, 14), Cells(loI, 15)).HorizontalAlignment = xlCenter
Next loI
Range(Cells(loI, 14), Cells(loI, 15)).Font.ColorIndex = 3
End With
Worksheets("tabelle3").Activate
End Sub
jedoch funktioniert es nicht das die zelleninhalte von spalte n und o ab zeile 2 vor der berechnung gelöscht werden.
was könnte der grund sein?