Excel extrem langsam durch VBA
23.09.2014 14:26:58
Sparrow
Mein Excel ist leider extrem langsam, vermutlich durch eine komplizierte VBA Programmierung - diese lautet wie folgt:
Tabelle 1:
Private Sub Worksheet_Deactivate()
Application.ScreenUpdating = False
ActiveWorkbook.Worksheets("Ereignisse").ListObjects("Ereignisse").Sort. _
SortFields.Clear
ActiveWorkbook.Worksheets("Ereignisse").ListObjects("Ereignisse").Sort. _
SortFields.Add Key:=Range("Ereignisse[Name]"), SortOn:=xlSortOnValues, _
Order:=xlAscending, DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("Ereignisse").ListObjects("Ereignisse").Sort
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Application.ScreenUpdating = True
End Sub
Tabelle 2:
Private Sub Worksheet_Deactivate()
Application.ScreenUpdating = False
ActiveWorkbook.Worksheets("Basisdaten").ListObjects("Basisdaten").Sort. _
SortFields.Clear
ActiveWorkbook.Worksheets("Basisdaten").ListObjects("Basisdaten").Sort. _
SortFields.Add Key:=Range("Basisdaten[Nachname]"), SortOn:=xlSortOnValues, _
Order:=xlAscending, DataOption:=xlSortNormal
ActiveWorkbook.Worksheets("Basisdaten").ListObjects("Basisdaten").Sort. _
SortFields.Add Key:=Range("Basisdaten[Vorname]"), SortOn:=xlSortOnValues, _
Order:=xlAscending, DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("Basisdaten").ListObjects("Basisdaten").Sort
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Application.ScreenUpdating = True
End Sub
Hat jemand eine Idee wie ich diesen Code vereinfachen könnte? Oder braucht ihr mehr Infos? Vielen Dank im Voraus!Sascha