Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Flashing Cells.

This is a discussion on Flashing Cells. within the Excel Questions forums, part of the Question Forums category; Hi Everybody, In Microsoft word you can make a text blink/flash.This is a nice formatting feature. Does anyone know if ...

  1. #1
    Board Regular Jaafar Tribak's Avatar
    Join Date
    Dec 2002
    Location
    Larache--Morocco
    Posts
    4,965

    Default

    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.

  2. #2
    MrExcel MVP Ivan F Moala's Avatar
    Join Date
    Feb 2002
    Location
    Auckland, New Zealand
    Posts
    4,209

    Default

    There are a number of ways to do this.
    Do a seach on this site...

    If no success ?? then I can provide some examples...
    Kind Regards,
    Ivan F Moala From the City of Sails

  3. #3
    Board Regular Jaafar Tribak's Avatar
    Join Date
    Dec 2002
    Location
    Larache--Morocco
    Posts
    4,965

    Default

    Thanks Ivan but you forgot to poste the link.

    Jaafar.

  4. #4
    Board Regular
    Join Date
    Oct 2002
    Location
    Yorkshire UK
    Posts
    213

    Default

    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


  5. #5
    Board Regular
    Join Date
    Mar 2002
    Posts
    362

    Default

    Sorry, almost double posted.

    [ This Message was edited by: Noir on 2002-12-27 09:10 ]

  6. #6
    Board Regular
    Join Date
    Mar 2002
    Posts
    362

    Default

    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

    Noir


  7. #7
    Board Regular Jaafar Tribak's Avatar
    Join Date
    Dec 2002
    Location
    Larache--Morocco
    Posts
    4,965

    Default

    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

  8. #8
    MrExcel MVP tusharm's Avatar
    Join Date
    May 2002
    Posts
    10,924

    Default

    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.

  9. #9
    MrExcel MVP Joe Was's Avatar
    Join Date
    Feb 2002
    Location
    Central Florida, USA
    Posts
    7,539

    Default

    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


    JSW: Try and try again: "The way of the Coder!"

  10. #10
    Board Regular
    Join Date
    Dec 2002
    Posts
    1,199

    Default

    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

Page 1 of 2 12 LastLast

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


DMCA.com