Langsames Makro
29.10.2020 12:31:39
Severin
Allerdings ist meine Datenmatix gross und mein Makro braucht in etwa 10 min bis die Daten verarbeitet sind.
Gibt es da nicht eine schnellere Lösung?
Set ws = ThisWorkbook.Sheets("Data")
Dim lAnfang As Long
Dim lLetzteZeile As Long
Dim Anfang As Long
Dim Zeile As Long
Dim Suchstring As String
lLetzteZeile = ws.Range("A" & rows.Count).End(xlUp).Row
Anfang = 2
SuchstringA = "M"
SuchstringI = "S"
With ws
For Zeile = Anfang To lLetzteZeile
If .Cells(Zeile, 1) <> "" Then~f~<br>
~f~ If InStr(1, Cells(Zeile, 1).Value, "M") > 0 Then~f~<br>
Sheets("Test").Cells(Zeile, 1) = Mid(.Cells(Zeile, 1), _<br>
InStr(.Cells(Zeile, 1), SuchstringA) - 4, _<br>
Len(InStr(.Cells(Zeile, 1), SuchstringA)) + 4)<br>
Else<br>
End If<br>
<br>
~f~ If InStr(1, Cells(Zeile, 1).Value, "S") > 0 Then
Sheets("Test").Cells(Zeile, 9) = Mid(.Cells(Zeile, 1), _
InStr(.Cells(Zeile, 1), SuchstringI) - 4, _
Len(InStr(.Cells(Zeile, 1), SuchstringI)) + 3)
Else
End If
End If
Next Zeile
End With
Ich danke für eine Rückmeldung.
Liebe Grüsse