Makro schneller machen - suchen/ersetzen
lutz
ich muß eine SAP-Liste umformatieren und habe dazu folgendes Makro:
Sub PunktinKomma()
Speed_on
Dim c As Range
For Each c In Selection.Cells
If (Not IsEmpty(c)) And (Not IsNull(c)) Then
If Left(c.Formula, 1) = "'" Then
c = Application.Substitute(c, ".", ",")
Else
c = "'" & Application.Substitute(c, ".", ",")
End If
End If
Next c
Speed_off
End Sub
Sub TextinZahl()
Speed_on
Dim c As Range
For Each c In Selection.Cells
If (Not IsEmpty(c)) And (Not IsNull(c)) Then
If Left(c.Formula, 1) = "=" Then
c = Application.Substitute(c, "'", "") * 1
Else
c = Application.Substitute(c, "'", "") * 1
End If
End If
Next c
With Selection
.HorizontalAlignment = xlGeneral
End With
Speed_off
End Sub
Sub Speed_on()
Application.ScreenUpdating = False
Application.EnableEvents = False
Application.DisplayAlerts = False
Application.Calculation = xlManual
End Sub
Sub Speed_off()
Application.ScreenUpdating = True
Application.EnableEvents = True
Application.DisplayAlerts = True
Application.Calculation = xlAutomatic
End Sub
Die Makros lasse ich beide hintereinander laufen - leider dauert jedes bei über 60.000 Datensätzen über 3 Minuten - trotz Speed_on und Speed_off.Kenn jemand einen Weg das zu beschleunigen?
Vielen Dank für Eure Hilfe und viele Grüße Lutz