Flashing Cells.

Jaafar Tribak

Well-known Member
Joined
Dec 5, 2002
Messages
9,779
Office Version
  1. 2016
Platform
  1. Windows
Hi Everybody,

In Microsoft word you can make a text blink/flash.This is a nice formatting feature.

Does anyone know if there is a way of doing the same or create a similar effect in excel ?

I have tried linking part of a word document but it doesn't work.

Any suggestions will be much appreciated.
Thank you.

Jaafar.
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
There are a number of ways to do this.
Do a seach on this site...

If no success ?? then I can provide some examples...
 
Upvote 0
Hi

Ivans suggestion to use the search (self-help) reveals a good depth of posts on the subject even by using your key words 'blink & flash'.

A good starting point might be a post by stminz_ 2002-10-11(17.20)

Hope this helps
 
Upvote 0
Hi Rafaaj2000,
Here are 2 separate codes i received from this board some time ago. I have tried them both and both work perfectly. The first set of code causes your cell background to flash. The second set causes the font to flash.

*Please place code into a new module*

Code#1:

Sub FlashBack()
'Make cell range Background color, flash x times, x fast, in x color,
'when Ctrl-a is pressed, you must set this macro option.

Dim newColor As Integer
Dim myCell As Range
Dim x As Integer
Dim fSpeed

'Make this cell range background flash!
Set myCell = Range("A1:A2")
Application.DisplayStatusBar = True
Application.StatusBar = "... Select Cell to Stop and Edit or Wait for Flashing to Stop! "

'Make cell background flash to this color!
'Black 25, Magenta 26, Yellow 27, Cyan 28, Violet 29, Dark Red 30,
'Teal 31, Blue 32, White 2, Red 3, Light Blue 41, Dark Blue 11,
'Gray-50% 16, Gray-25% 15, Bright Cyan 8.
newColor = 27

'Make the cell range flash fast: 0.01 to slow: 0.99
fSpeed = 0.2

'Make cell flash, this many times!
Do Until x = 35

'Run loop!
DoEvents
Start = Timer
Delay = Start + fSpeed
Do Until Timer > Delay
DoEvents
myCell.Interior.ColorIndex = newColor
Loop
Start = Timer
Delay = Start + fSpeed
Do Until Timer > Delay
DoEvents
myCell.Interior.ColorIndex = xlNone
Loop
x = x + 1
Loop
Application.StatusBar = False
Application.DisplayStatusBar = Application.DisplayStatusBar
End Sub



Code#2:

Sub FlashFont()
'Make cell range font flash, x times, x fast, in x color,
'when Ctrl-z is pressed.
Dim newColor As Integer
Dim myCell As Range
Dim x As Integer
Dim fSpeed

'Make this cell range font flash!
Set myCell = Range("A1:A2")
Application.DisplayStatusBar = True
Application.StatusBar = "... Select Cell to Stop and Edit or Wait for Flashing to Stop! "

'Make cell font flash to this color!
'Black 25, Magenta 26, Yellow 27, Cyan 28, Violet 29, Dark Red 30,
'Teal 31, Blue 32, White 2, Red 3, Light Blue 41, Dark Blue 11,
'Gray-50% 16, Gray-25% 15, Bright Cyan 8.

newColor = 3

'Make the cell range flash fast: 0.01 to slow: 0.99
fSpeed = 0.3

'Make cell flash, this many times!
Do Until x = 20

'Run loop!
DoEvents
Start = Timer
Delay = Start + fSpeed
Do Until Timer > Delay
DoEvents
myCell.Font.ColorIndex = newColor
Loop
Start = Timer
Delay = Start + fSpeed
Do Until Timer > Delay
DoEvents
myCell.Font.ColorIndex = xlAutomatic
Loop
x = x + 1
Loop
Application.StatusBar = False
Application.DisplayStatusBar = Application.DisplayStatusBar
End Sub
Sub reSetFlash()
'Re-set cell range color if edit break on color, Ctrl-r to re-set!
ActiveCell.Select
Selection.Interior.ColorIndex = xlNone
End Sub

I hope this is what you were looking for :smile:

Noir
 
Upvote 0
Hi,
Thanks everyone for the answers.
But the problem with all the procedures posted so far is that they stop working properly as soon as the user starts editing the sheet or prevent to copy a cell.

Thank you again.
Jaafar
 
Upvote 0
XL will not run any VBA code while it is in 'Edit' mode.

FWIW, in Word, the background stops blinking if a dialog box is on top.
 
Upvote 0
I wrote the code above and have never been able to get it or any other flash code to flash independent of edit or selection as they are all macro code.

This code will scroll your text back and forth in a cell or merged cells even if you select the cell for edit! Hope it does the trick. JSW

P.S. I think I have seen posted a windows call that changes the way Excel works and gives flash control over cells. You may find it if you look in search? I don't use code that changes how windows works, it's buggy enough on its own! JSW

Sub AmiText()
'Run from Sheet Module.
'Will move text string to the right in a cell
'as a steped scroll "y" times.
Dim myText As String
Dim x As Integer, y As Integer
Dim myStart, myDelay
'Load the text to display & animate below here!
myText = " Animated Text!"
'Trap errors.
On Error GoTo myEnd
'Loop through the scrolling animation "y" times.
For y = 1 To 5
'"x" number of steps to the animation.
For x = 1 To 30
myStart = Timer
'This is how smooth or course to scroll right,
'the smaller the number the smoother the scroll.
myDelay = myStart + 0.1
Do While Timer < myDelay
'This is the cell to animate [Cell].
[D6] = Space(x) & myText
DoEvents
Loop
DoEvents
'Reset the timer as needed.
myStart = Timer
myDelay = myStart + 0.1
'Show the text string "x" times.
Next x
'Repeat this for "y" times.
Next y
'Reset the displayed text to blank.
[D6] = ""
'On Error End.
myEnd:
End
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
With ActiveWindow
'If "AmiText" lost focus: Clear the displayed animation.
'If user works on Sheet, stop code & clear display.
[D6] = ""
End With
End Sub
 
Upvote 0
Here's an old-fashioned method; you grandpa would be proud... select the cell you want to flash and run this:

For j = 1 To 10
For i = 1 To 500
Selection.Font.Bold = True
Next i
For i = 1 To 500
Selection.Font.Bold = False
Next i
Next j

Please don't be upset... I know its not pretty, but it works
 
Upvote 0

Forum statistics

Threads
1,223,362
Messages
6,171,634
Members
452,411
Latest member
sprichwort

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top