Mouse Over Animation.xlsb | ||||||
---|---|---|---|---|---|---|
A | B | C | D | |||
1 | RunAnimation | RunAnimation | RunAnimation | 1 | ||
2 | Don't Run | Don't Run | ||||
3 | ||||||
Sheet1 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
D1 | D1 | =COUNTA(C1:C2) |
A1 | A1 | =IFERROR(HYPERLINK(ChangeAnimation(B1)),"RunAnimation") |
A2 | A2 | =IFERROR(HYPERLINK(ChangeAnimation(B2)),"Don't Run") |
Named Ranges | ||
---|---|---|
Name | Refers To | Cells |
NameRollover | =Sheet1!$C$1 | D1 |
Cells with Conditional Formatting | ||||
---|---|---|---|---|
Cell | Condition | Cell Format | Stop If True | |
A1:A2 | Expression | =$A1=$C$1 | text | NO |
Private Sub Worksheet_Calculate()
If [C1] = "RunAnimation" Then PlayAnimation
End Sub
Option Explicit
Public Function ChangeAnimation(Name As Range)
Range("NameRollover") = Name.Value
End Function
Sub PlayAnimation()
Sheet1.Shapes("Image1").Visible = True
Dim x As Long: x = 0
Do
DoEvents
x = x + 2
Sheet1.Shapes("Image1").Left = x
Sheet1.Shapes("Image1").Rotation = x
Loop Until x = 500
Sheet1.Shapes("Image1").Visible = False
End Sub