below is code that takes detials from a spreadsheet and unloads and reloads and continues like that. my only problem is after a while the text stops scrolling and the application seems to stop but with no errors I am convinced there may be a problem with the loop. Help !
Code:
Function Marquees()
Sheets("Sales Info").Select
Dim StartTimer As Single, timeWait As Single
Dim i As Integer
Dim Marquee As String
timeWait = 0.08
Do
'Marquee without trailing spaces
Marquee = Range("b46")
Me.txtMarquee.TextAlign = fmTextAlignLeft
For i = Len(Marquee) To 1 Step -1
Me.txtMarquee.Text = Right(Marquee, i)
StartTimer = Timer
Do While Timer < StartTimer + timeWait
DoEvents
Loop
Next 'i
'No time-delay here for immediate flow from the right
Me.txtMarquee.Text = ""
Me.txtMarquee.TextAlign = fmTextAlignRight
For i = 1 To Len(Marquee) - 1
Me.txtMarquee.Text = Mid(Marquee, 1, i)
StartTimer = Timer
Do While Timer < StartTimer + timeWait
DoEvents
Loop
Next 'i
'No time-delay after the full string, for smooth re-flow
Me.txtMarquee.Text = Mid(Marquee, 1, i)
Call Displays
Loop
End Function
Function Displays()
lblDate.Caption = Date
lblDate.Caption = Format(lblDate, "Long Date")
'production
Sheets("Production").Select
lblProduction.Caption = Range("a11")
lblProduction.Caption = Format(expression:=lblProduction.Caption, Format:="00,000")
lblProductionTarget.Caption = Range("b11")
lblProductionTarget.Caption = Format(expression:=lblProductionTarget.Caption, Format:="00,000")
lblPacked.Caption = Range("c11")
lblPacked.Caption = Format(expression:=lblPacked.Caption, Format:="00,000")
'sales
Sheets("Sales Info").Select
lblSales.Caption = Range("a41")
lblSales.Caption = Format(expression:=lblSales.Caption, Format:="00,000")
lblSalesTarget.Caption = Range("b41")
lblSalesTarget.Caption = Format(expression:=lblSalesTarget.Caption, Format:="00,000")
Label15.Caption = Range("c41")
Label15.Caption = Format(expression:=Label15.Caption, Format:="00,000")
'complaints
Sheets("Complaints Info").Select
lblComplaints.Caption = Range("a18")
lblComplaintsTarget.Caption = Range("b18")
Label16.Caption = Range("c18")
Call Marquees
End Function
Private Sub UserForm_Activate()
Call Displays
End Sub
Private Sub UserForm_Click()
Unload Me
End Sub