AW: Automatisches Sortieren im Zeitintervall
06.07.2009 16:02:16
Tino
Hallo,
stellen den Code in ein Modul.
Bei Verwendung von OnTime solltest Du die Datei und die Tabelle Explicit mit angeben.
Vollautomatisch beim öffnen der Datei:
kommt als Code in DieseArbeitsmappe
Option Explicit
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Call StopTimer
End Sub
Private Sub Workbook_Open()
Call StartTimer
End Sub
kommt als Code in Modul1
Option Explicit
Public Date_Zeit As Date
Sub StopTimer()
On Error Resume Next
Application.OnTime Date_Zeit, "test", , False
End Sub
Sub StartTimer()
Date_Zeit = Now + TimeSerial(0, 0, 30)
Application.OnTime Date_Zeit, "test"
End Sub
Sub Test()
With ThisWorkbook.Sheets("Tabelle1")
.Range("A2:C81").Sort Key1:=.Range("C2"), Order1:=xlAscending, Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
End With
Call StartTimer
End Sub
Gruß Tino