AW: Aktuelle mitlaufende Uhrzeit
01.08.2003 07:00:13
Hajo_Zi
Hallo Thomas
hättest Du ein Link zu den Beispielen gemacht, hätten wir auch gewußt welchen Code wir nicht nochmal posten müssen.
Hier mal zwei Beisüpiele
' **************************************************************
' Modul: Titeltzeile_Zeit Typ = Userform
' **************************************************************
Option Explicit
' Ansatz von GraFri mit Lauftext
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Dim Stopped As Integer
Private Sub UserForm_Initialize()
Stopped = 1
End Sub
Private Sub UserForm_Layout()
Call Scroll_Text
End Sub
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
Stopped = 1
End Sub
Private Sub Scroll_Text()
Stopped = 0
Do
Me.Caption = Time
Call Pause(100, 1) 'Tempo des Wechsel
Loop Until Stopped = 1
End Sub
Private Sub Pause(ByVal Pau As Single, ByVal DoEv As Integer)
Call Sleep(Pau)
If DoEv = 1 Then DoEvents
End Sub
Private Sub CommandButton1_Click()
If Stopped = 1 Then
Stopped = 0
CommandButton1.Caption = "Stop"
Call Scroll_Text
Else
Stopped = 1
CommandButton1.Caption = "Start"
End If
End Sub
' **************************************************************
' Modul: TextBox_Zeit Typ = Userform
' **************************************************************
Option Explicit
' Ansatz von GraFri mit Lauftext
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Dim Stopped As Integer
Private Sub UserForm_Initialize()
Stopped = 1
End Sub
Private Sub UserForm_Layout()
Call Scroll_Text
End Sub
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
Stopped = 1
End Sub
Private Sub Scroll_Text()
Stopped = 0
Do
TextBox1 = Time
Call Pause(100, 1) 'Tempo des Wechsel
Loop Until Stopped = 1
End Sub
Private Sub Pause(ByVal Pau As Single, ByVal DoEv As Integer)
Call Sleep(Pau)
If DoEv = 1 Then DoEvents
End Sub
Private Sub CommandButton1_Click()
If Stopped = 1 Then
Stopped = 0
CommandButton1.Caption = "Stop"
Call Scroll_Text
Else
Stopped = 1
CommandButton1.Caption = "Start"
End If
End Sub
Code eingefügt mit: Excel Code Jeanie
Falls Code vorhanden wurde dieser getestet unter Betriebssystem XP Pro und Excel Version XP SBE.
Bitte kein Mail, Probleme sollen im Forum gelöst werden.
Microsoft MVP für Excel
Das Forum lebt auch von den Rückmeldungen.