Option Explicit
'This form demos a Marquee (moving word Sign). Put your message in the selected Cell,
'Make sure you have at least 1 trailing space to seperate your rolling text.
'The default cell for this demo, is a Named cell called 'Marquee'. You can just pass
'the routine as cell or range address such as Cells(1,1) or Range("A1").
Public gsngSpeed As Single 'Speed value, should be in Seconds pause, but really varries.
Public Sub RunMarquee()
'There is no timer control in VBA excel, there is a timer function that returns the number of
'seconds since midnight. Weird, but workable.
Dim sngStart As Single
Dim sngPausetime As Single
On Error Resume Next
'Application.WindowState = xlMaximized
sngStart = Timer ' Set start time. No. of seconds since midnight
StartHere:
sngPausetime = gsngSpeed
'following will pause 1 second
Do While Timer < sngStart + sngPausetime
DoEvents ' Yield to other processes.
Loop
'Now run the marquee
Call CellMarquee(Range("Marquee")) 'put in your own range here, like Cells(1,1) or Range("A1") etc.
sngStart = Timer
GoTo StartHere
End Sub
Private Sub CellMarquee(rng As Range)
'Set what you want displayed in the cell, should have at least 1 trailing space.
Dim buffer As String
buffer = rng.Value
If Len(buffer) > 1 Then
rng.Value = Mid$(buffer, 2) & Left$(buffer, 1)
End If
End Sub