Problem mit Makro
30.10.2018 08:50:57
Peter
ich habe aus dem Archiv ein Makro übernommen und abgeändert.
Beide Makros laufen, wenn Wert in Spalte vorhanden ist einwandfrei und sehr schnell.
Wenn jedoch keine Werte vorhanden sind, dann dauert das Durchlaufen sehr langsam.
Wenn ich bei "Cells(zeile, spalte + 1) = "" ': Exit For" das : Exit For aktiviere geht gar nichts mehr.
Sub versuch2SpaltenMN()
Dim spalte As Long
Dim zeile As Long
For spalte = 13 To 14 Step 2
For zeile = 11 To Cells(Rows.Count, 12).End(xlUp).Row
If Cells(zeile, spalte) "" Then
Cells(zeile, spalte + 1) = "X": Exit For
Else
Cells(zeile, spalte + 1) = "" ': Exit For
End If
Next
Next
End Sub
Sub versuch2SpaltenOP()
Dim spalte As Long
Dim zeile As Long
For spalte = 15 To 16 Step 2
For zeile = 11 To Cells(Rows.Count, 12).End(xlUp).Row
If Cells(zeile, spalte) "" Then
Cells(zeile, spalte + 1) = "X": Exit For
Else
Cells(zeile, spalte + 1) = "" ': Exit For
End If
Next
Next
End Sub
Könnt ihr mir bitte helfen um ein optimales Ergebnis zu erzielen.Besten Dank für eure Hilfe.
Gruss
Peter