Hallo zusammen,
ich überprüfe mit folgender Schleife eine Matrix von ca. 49000 Zellen. Dies nimmt entsprechend Zeit in Anspruch und ich bin auf der Suche ob es hier einen schnelleren Weg gibt.
Dim c As Integer
Dim r As Integer
Dim last_c As Integer
Dim last_r As Integer
Sub test()
last_r = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row
last_c = ActiveSheet.Cells(1, Columns.Count).End(xlToLeft).Column
For c = 4 To last_c
For r = 2 To last_r
If Cells(1, c) >= Cells(r, 1) And Cells(1, c) <= Cells(r, 3) Then
Cells(r, c) = "1"
ElseIf Cells(1, c) >= Cells(r, 1) And Cells(1, c) <= Cells(r, 2) Then
Cells(r, c) = "2"
Else
Cells(r, c) = ""
End If
Next r
Next c
End Sub
Danke für Eure Hilfe |