Wieso so langsam
06.06.2016 16:24:49
Gregor
Habe einen einfachen Code geschrieben, läuft aber sehr, sehr langsam. Wieso das bzw. wie löse ich das schneller. Spalte 6 hat rund 1000 Zeilen.
Sub test()
Application.ScreenUpdating = False
Application.EnableEvents = False
Dim c As Range
Dim Vergleich As Variant
Dim intLastRow As Double, start As Double
With Worksheets("Liste")
intLastRow = Worksheets("Daten").Cells(Rows.Count, 1).End(xlUp).Row
For start = 2 To intLastRow
Vergleich = Worksheets("Daten").Cells(start, 1)
For Each c In Intersect(.UsedRange.Cells, Columns(6))
If c.Text = Vergleich Then
.Cells(c.Row, "G") = Worksheets("Daten").Cells(start, 2)
.Cells(c.Row, "H") = Worksheets("Daten").Cells(start, 3)
End If
Next
Next
End With
Application.ScreenUpdating = True
Application.EnableEvents = True
End Sub
Danke und GrussGregor