Geschwindigkeit
26.02.2007 13:34:00
Walburga
sieht jemand eine Möglichkeit, folgendes Makro schneller zu machen (muss ca. 5.000 Zeilen durchlaufen)
Sub Gliederung_ein()
Dim a As Long, i As Long
With Sheets("Plan")
Selection.ClearOutline
a = .UsedRange.Rows.Count
For i = 2 To a
If IsNumeric(.Cells(i, 2)) And .Cells(i, 2) = "" Then .Rows(i).Group
If IsNumeric(.Cells(i, 4)) And .Cells(i, 4) <> "" Then .Rows(i).Group
If IsNumeric(.Cells(i, 5)) And .Cells(i, 5) <> "" Then .Rows(i).Group
If IsNumeric(.Cells(i, 6)) And .Cells(i, 6) <> "" Then .Rows(i).Group
If IsNumeric(.Cells(i, 1)) And .Cells(i, 1) = "" Then .Rows(i).Group
Next
.Outline.ShowLevels RowLevels:=3
.Outline.ShowLevels RowLevels:=2
.Outline.ShowLevels RowLevels:=1
.CommandButton1.Caption = "Gliederung aus!"
.CommandButton1.BackColor = &HFF& 'rot
End With
End Sub
Vielen Dank für's Überlegen
Gruss Walburga