Logo 
Search:

MS Office Forum

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds

How to animate cells in Excel

  Asked By: Kevin    Date: Sep 05    Category: MS Office    Views: 5420
  

I want some important cells in my worksheet to be blinking , so long as the
worksheet is open. This is for the purposes of drawing the attention of the
user to those blinking cells. How do I make this happen in Excel (In Word I
can do this by formatting the fonts ; I want to create similar effect in
Excel)

Will you please help me to solve this problem?

Share: 

 

2 Answers Found

 
Answer #1    Answered By: Gerald Cruz     Answered On: Sep 05

One way:
1. Put this in the Thisworkbook code module:

Private Sub Workbook_Open()
blink
End Sub

2. then this line at the top of a standard code module:

Dim flipflop As Boolean

3. then this below any other code in the module:

Sub blink()
If Range("A1") = "x" Then Exit Sub
NameExists = False
For Each n In ThisWorkbook.Names
If UCase(n.Name) = "AAACELLS" Then
NameExists = True
Exit For
End If
Next n
If NameExists Then
Application.OnTime Now + TimeValue("00:00:01"), "blink"
flipflop = Not flipflop
If flipflop Then
Range("aaacells").Interior.ColorIndex = 3
Else
Range("aaacells").Interior.ColorIndex = 6
End If
End If
End Sub


4. Define a name called "aaacells" being the cell/s, contiguous or
not, that you want to have blink.

5. Save and close the workbook. Open it.

Notes:

The blink macro calls itself at about 1 second intervals due to the
line:
Application.OnTime Now + TimeValue("00:00:01"), "blink"
Adjust as required.

The line:
If Range("A1") = "x" Then Exit Sub
should be commented out or deleted - it was just there to stop the
loop while debugging (by putting an 'x' into cell A1 of the active
sheet).

The name 'aaacells' should exist in the workbook somewhere otherwise
it won't blink. (I used a name with 'aaa' at the beginning so that the
loop which checks for the existence of the name exits early - for the
most part of no consequence unless you have hundreds of defined names
in the workbook.)

You can start the blinking manually by running the macro.

 
Answer #2    Answered By: Zoar Mizrachi     Answered On: Sep 05

> 1. Put this in the Thisworkbook code module:

 
Didn't find what you were looking for? Find more on How to animate cells in Excel Or get search suggestion and latest updates.




Tagged: