How to Animate Text in Excel (2 Methods)

Method 1 – Scrolling Text Animation

animate text in excel

  • Open the Visual Basic Window by pressing Alt+F11.
  • Insert a new module by going to Insert > Module.

  • Copy the following code and paste it into the new module:
' Scrolling Text
Sub Start_Text_Scroll()
My_Value = ActiveSheet.Range("C4").Value
Final_Value = WorksheetFunction.Rept(My_Value, 1)
Do
For initial = 1 To Len(Final_Value)
    Length = Len(Final_Value) - 1
    DoEvents
    For AA = 1 To 10000000
    AA = AA + 1
    Next
    Range("B6") = Mid(Final_Value, initial, Length) & Left(Final_Value, initial - 1)
Next
Loop
End Sub
Sub Stop_Scrolling()
End
End Sub

Animation of Text by Scrolling in Excel

️ How Does the Code Work?

  • Start_Text_Scroll subroutine scrolls the text stored in cell C4.
  • It creates a loop that shifts the text from left to right.
  • Adjust the speed by changing the value of AA.
  • To stop scrolling, use the Stop_Scrolling subroutine.

  • Add buttons for starting and stopping scrolling:
    • Insert shapes (e.g., rectangles) from the Insert tab.

Animation of Text by Scrolling in Excel

    • Enter Start Scrolling inside one shape.

    • Assign the Start_Text_Scroll macro to this shape.

Animation of Text by Scrolling in Excel

    • Click OK.

Animation of Text by Scrolling in Excel

    • Repeat for the Stop Scrolling button.

  • Use the buttons to start and stop scrolling the Text message.

Animation of Text by Scrolling in Excel


Method 2 – Blinking Animated Text

  • Draw Text Boxes
    • Go to the Insert tab and select Text > Text Box.

Blinking Animated Text in Excel

    • Draw a text box with your preferred size.

Blinking Animated Text in Excel

    • Enter the text you want to make blink.

  • Add Empty Text Boxes
    • Create additional text boxes of similar shapes and sizes.

Blinking Animated Text in Excel

  • Rename Text Boxes
    • Rename the text boxes as follows: TextBox 1, TextBox 2, and so on.

Blinking Animated Text in Excel

  • Overlay Text Boxes
    • Arrange all text boxes so they overlap and appear as a single box.

Blinking Animated Text in Excel

  • VBA Code
    • Open the VBA editor by pressing Alt+F11.
    • Insert a new module (Insert > Module).

  • Enter the following code:
Sub Blink()
On Error GoTo skip
Do While Range("B4").Value = "Blink"
For txtbx = 1 To 5
ActiveSheet.Shapes("TextBox " & txtbx).ZOrder msoBringToFront
DoEvents
Next txtbx
Loop
skip:
ActiveSheet.Shapes("TextBox 1").ZOrder msoBringToFront
Exit Sub
End Sub

Blinking Animated Text in Excel

️ How Does the Code Work?

  • The Blink subroutine brings text boxes to the front one by one (from TextBox 1 to TextBox 5) using the ZOrder command.
  • Error handling ensures that the first text box remains visible.

  • Worksheet Code
    • In the worksheet code, enter:
Private Sub Worksheet_Change(ByVal Tgt As Range)
If Tgt = Range("B4") Then
Call Blink
End If
End Sub

️ How Does the Code Work?

  • When data is inserted into cell B4, Excel calls the Blink module.

Blinking Animated Text in Excel


Things to Remember

  • In the 2nd method, remember to correctly rename and align the text boxes for smooth animation

Download Practice Workbook

You can download the practice workbook from here:


Related Articles

Get FREE Advanced Excel Exercises with Solutions!
Aniruddah Alam
Aniruddah Alam

Md. Aniruddah Alam, a graduate of Bangladesh University of Engineering & Technology, Dhaka, holds a BSc.Engg in Naval Architecture & Marine Engineering. Joining Softeko in August 2022 as an Excel and VBA content developer, he has authored 90+ articles, covering fundamental to advanced Excel topics. He actively develops VBA codes for Excel automation and offers solutions in the Exceldemy Forum. Beyond work, he finds leisure in reading books, and taking relaxing walks, showcasing well-rounded blend of professional and... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo