SmallScrall wird ignoriert
19.01.2022 07:59:42
Oraculix
In meiner Tabelle klicke ich Doppelt in die erste Zeile und die Spalte wird Sortiert.
Aber leider wird mir die Taballe immer nach Links verschoben nach dem sortieren.
Also habe ich Excel gesagt ActiveWindow.SmallScroll ToRight:=-2.
Excel Ignoriert diese Befehl Warum?
Frage Wie Bringe ich Excel dazu das er nach dem sortieren 2 spalten nach rechts scrollt?
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
'Doppelklick in Erste Zeile Sortiert von A-Z
Application.ScreenUpdating = False
Dim i As Integer
If Not Application.Intersect(Target, Range("A1:GP1")) Is Nothing Then
With ActiveCell
Range(Cells(2, .Column), Cells(Rows.Count, .Column).End(xlUp)).Sort _
Key1:=Cells(2, .Column), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
End With
End If
Application.Calculation = xlCalculationAutomatic
Application.SendKeys ("{enter}") 'Weil in Zeile1 überall Formeln sind
Worksheets("Schauspieler").Activate
ActiveWindow.SmallScroll ToRight:=-2 'Wird einfach Ignoriert
Application.ScreenUpdating = True
ActiveWindow.SmallScroll ToRight:=-2 'Wird einfach Ignoriert
End Sub
GrußOraculix