Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Sub CommandButton1_Click()
Dim i As Long, txt As String, rng As Range
Set rng = Range("A1")
txt = "HELLO WORLD"
For i = 1 To Len(txt)
rng.Value = Left(txt, i)
Sleep 50
Next
End Sub
Sub Macro1()
Dim sTxt As String
Dim yTxt As String
Dim x As Integer, y As Integer
Dim Start, Delay
Dim myCell, myCell2
Dim Indexer As Single
Dim blnRight As Boolean
On Error Resume Next
Set myCell = Range("B2")
Set myCell2 = Range("D3")
Indexer = 50
Application.DisplayStatusBar = True
Application.StatusBar = "... Select Cell to Stop and Edit " & _
"or Wait for Flashing to Stop! "
sTxt = "Michael is in the office : " & Format$(Now, "d mmmm yyyy") & "!!!!!!!!"
yTxt = "Doing everybody else's work"
Do While Range("A1").Value <> ""
DoEvents
For y = 1 To 2 'Indexer Loops through the scrolling
For x = 1 To Indexer 'Index number of times
Start = Timer 'Set start to internal timer
Delay = Start + 0.02 'Set delay for .15 secs
Do While Timer < Delay 'Do the display routine
If blnRight Then 'have u reached the right hand side
[D2] = Space(Indexer - x) & sTxt
[D3] = Space(x) & yTxt 'Show 1 str @ a time
Else
[D2] = Space(x) & sTxt
[D3] = Space(Indexer - x) & yTxt 'Show 1 str @ a time
End If
DoEvents
Loop 'Loop until delay is up
Start = Timer 'and reset the timer
Delay = Start + 0.02 'and the delay
If x = Indexer Then blnRight = Not (blnRight) 'True or false
Next x 'Show the next str
Next y
Loop 'Do this again
[D2] = "" 'Reset
[D3] = ""
JACK:
Application.StatusBar = False
Application.DisplayStatusBar = Application.DisplayStatusBar
End Sub
Sub Ticker()
Application.Calculation = xlCalculationManual
Dim tMsg As String, tCell As Range, tLen As Long, tPos As Long
Dim Start, Delay
Set tCell = Range("A1")
tMsg = "This is a test message!"
With tCell.Font
.Name = "Courier New"
.FontStyle = "Regular"
.Size = 10
End With
tCell.ColumnWidth = Round(tCell.ColumnWidth, 0)
tLen = tCell.ColumnWidth - 1
Do
Start = Timer
If tPos > Len(tMsg) Then
tPos = 1
Delay = Timer + 1
Else
tPos = tPos + 1
Delay = Timer + 0.2
End If
Do While Timer < Delay
DoEvents
tCell.Value = Mid(tMsg, tPos, tLen)
Loop
Loop
End Sub
Sub worksheet_change(ByVal target As Range)
Application.Calculation = xlCalculationAutomatic
End Sub
Private Sub Workbook_Open()
Ticker
End Sub