Fortschrittsanzeige funktioniert nicht
20.02.2004 13:23:07
Michael Rapp
habe durch einen Hinweis aus diesem Forum einen Fortschrittsanzeiger auf der Seite von "Rob's Excel VBA Tips & Tricks" gefunden.
Hier ist das Problem damit: Die Fortschrittsanzeige funktioniert perfekt, nur leider nicht parallel zu dem Ablauf meiner Makros, für die ich eine Anzeige haben möchte. Nun dauert der ganze Ablauf doppelt so lange, und die Hälfte der Zeit gibt es keine Anzeige. Ist das überhaupt möglich, eine zeitgesteuerte Anzeige parallel zum Ablauf von Makros zu haben??
Hier ist der Code aus einem Standard Module:
Function fWriteStatus(ByVal intTheCount As Integer, _
ByVal intTheMax As Integer) As String
' aus dem Internet von "Rob's Excel VBA Tips & Tricks"
'16.2.2004 angepaßt durch MR
Dim intCount1 As Integer
Dim intCount2 As Integer
' First part of status bar
fWriteStatus = " |"
' Now add some spaces up to the value
' we wish to represent
For intCount1 = 1 To intTheCount
fWriteStatus = fWriteStatus & Chr(32)
Next intCount1
' add a box (is's a non-printing ascii
' character)
fWriteStatus = fWriteStatus & Chr(2)
' Fill the rest of the gauge with spaces
For intCount2 = intCount1 To intTheMax
fWriteStatus = fWriteStatus & Chr(32)
Next intCount2
' ...then add the end marker and a
' percentage complete figure.
fWriteStatus = fWriteStatus & "| " _
& Format(intTheCount / intTheMax, " 0% Die Verarbeitung Ihrer Information in allen Arbeitsblättern wird bald beendet werden.")
End Function
Sub sUsage()
For Count = 0 To 50
Application.StatusBar = fWriteStatus(Count, 50)
Application.Wait Now() + TimeValue("00:00:01")
Next
Application.StatusBar = False
End Sub
Dnake für jede Hilfe
Michael