|
|
|
|
|
|
Excel
|
Animated Word Art
|
|
Ease of Use
|
Easy
|
Version tested with
|
2000, 2003
|
Submitted by:
|
Brandtrock
|
Description:
|
WordArt in an Excel spreadsheet can be animated to a certain extent. This example illustrates how to twist the letters back and forth and how to spin the WordArt like an airplane propellor.
|
Discussion:
|
The animation of a WordArt object in a spreadsheet can make quite an impression on co-workers or clients. No real functionality is added, this is purely bells and whistles stuff.
|
Code:
|
instructions for use
|
Option Explicit
Dim oldcell As Range
Dim m As Variant
Dim i As Variant
Sub StartDemo()
On Error Resume Next
Set oldcell = ActiveCell
ActiveSheet.Shapes("WordArt 1").Select
m = 1
For i = 1 To 80
Selection.ShapeRange.TextEffect.Tracking = m
m = m + 0.125
DoEvents
Next i
For i = 80 To 1 Step -1
Selection.ShapeRange.TextEffect.Tracking = m
m = m - 0.125
DoEvents
Next i
Selection.ShapeRange.TextEffect.Tracking = 1
ActiveSheet.Shapes("WordArt 2").Select
For i = 1 To 8
Selection.ShapeRange.IncrementRotation 45#
DoEvents
Next i
Selection.ShapeRange.TextEffect.Tracking = 1
ActiveSheet.Shapes("WordArt 2").Select
m = 1
For i = 1 To 80
Selection.ShapeRange.TextEffect.Tracking = m
m = m + 0.25
DoEvents
Next i
For i = 80 To 1 Step -1
Selection.ShapeRange.TextEffect.Tracking = m
m = m - 0.25
DoEvents
Next i
Selection.ShapeRange.TextEffect.Tracking = 1
ActiveSheet.Shapes("WordArt 2").Select
For i = 1 To 16
Selection.ShapeRange.IncrementRotation 45#
DoEvents
Next i
Selection.ShapeRange.TextEffect.Tracking = 1
oldcell.Select
End Sub
Option Explicit
Private Sub Workbook_Open()
StartDemo
End Sub
|
How to use:
|
- Open a worksheet.
- Create two WordArts of your own design.
- Copy the code marked Code for Module1.
- Press Alt + F11 to open the Visual Basic Editor (VBE).
- From the Menu, choose Insert-Module.
- Paste the code into the right-hand code window.
- Double-click on the ThisWorkbook module.
- Select Workbook from the top left drop down box.
- Select Workbook Open from the right drop down box.
- Type StartDemo between the Private Sub Workbook_Open() line and the End Sub line.
- Close the VBE
- Save the file.
- Close the file.
|
Test the code:
|
- To test your code, simply open the workbook you just saved (or the example file). The Workbook Open event will fire the StartDemo macro upon opening.
|
Sample File:
|
Moving_Word_Art_xls.zip 12.14KB
|
Approved by mdmackillop
|
This entry has been viewed 310 times.
|
|