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

Flashing Text

This is a discussion on Flashing Text within the Excel Questions forums, part of the Question Forums category; Hi is there a way of making the text in a cell flash or blink, the text within the cell ...

  1. #1
    New Member
    Join Date
    Jan 2003
    Posts
    8

    Default

    Hi
    is there a way of making the text in a cell flash or blink, the text within the cell is controlled by an IF condition, its a prompt to highlite the entry field for information.
    Thanks
    Jason

  2. #2
    New Member
    Join Date
    Jan 2003
    Posts
    15

    Default

    Yes.

    It would be much easier to help you with an example if you provide more details...

    First, which cell or cells?
    What is the condition which brings about the flashing?

    What color will the text flash? As is?

    Do you want the cell's interior to flash instead, as well, or not at all?

    What condition or user action will stop the flashing?

    Will any other VBA procedures need processor time to run at the same time as the procedure which flashes your text?

    This question has been raised here before. Have you made a decent effort to search previous posts?

    Thanks,
    Anon

  3. #3
    Board Regular
    Join Date
    Feb 2002
    Location
    Sheffield, UK
    Posts
    249

    Default

    This is the best I can do. It uses VB and is definately not ideal, but here you go:
    Put this code into the code module for the sheet where you want to have flashing cells.

    Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Value = 55 Then
    For n = 1 To 10
    Target.Interior.Color = vbRed
    Delay (0.04)
    Target.Interior.ColorIndex = xlNone
    Delay (0.04)
    Next n
    End If
    End Sub

    Sub Delay(rTime As Single)
    'delay rTime seconds (min=.01, max=300)
    Dim oldTime As Variant
    'safety net
    If rTime < 0.01 Or rTime > 300 Then rTime = 1
    oldTime = Timer
    Do
    DoEvents
    Loop Until Timer - oldTime > rTime
    End Sub

    This will make a cell flash red if you type 55 in it. Obviously, change the 55 to whatever you want. You can also play about with the delay values to slow it down or speed it up. If you want it to flash a different colour, change the vbRed to whatever (there is a list in the VBA help somewhere for valid colours). If you want it to only happen for one cell, then add this to the start of the code:

    if target.row=3 and target.column=4 then

    (don't forget to close this with an endif at the bottom)
    this works for cell D3. For a different cell, change the row and column numbers.
    Note: this will only flash when the value in the cell changes to 55. To make it flash again, you must change it to something else and then back to 55. Hope this helps - like I said it isn't ideal, but its the only way I can think of.

    Phil

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

    Default

    Hi

    Have a look at a post by rafaaj2000 dated 2002-12-27 (02-55)

    Some useful VBA to try

    Hope this helps get you started

  5. #5
    Board Regular Sourdust's Avatar
    Join Date
    Sep 2002
    Location
    Edinburgh, Scotland
    Posts
    769

    Default

    This might be of some help to you. If not it is interesting anyway.

    http://www.mrexcel.com/board/viewtop...=34003&forum=2

  6. #6
    Board Regular
    Join Date
    Jan 2003
    Posts
    60

    Default

    You might want to try this site. Has amazing answers to a lot of things and I believe has the answer to your questions:

    http://j-walk.com/ss/excel/eee/eee002.txt

  7. #7
    New Member
    Join Date
    Jan 2003
    Posts
    8

    Default

    Cheers for your help, you guys.

    you must have miss read the message ANON why do you need all the infomation you asked for just to make text flash?.

    I didn't want an explanation of vba just to know if i could make the text flash.

    sounds like some one who likes the sound of their keyboard.

    Cheers evryone

    J

  8. #8
    New Member
    Join Date
    Jan 2003
    Posts
    15

    Default

    Duly noted J. Thanks for the heads up to not bother in the future.

  9. #9
    Board Regular
    Join Date
    Jul 2002
    Posts
    501

    Default Re: Flashing Text

    Can this code be changed:

    Code:
    Private Sub Worksheet_Change(ByVal Target As Range) 
    If Target.Value = 55 Then 
    For n = 1 To 10 
    Target.Interior.Color = vbRed 
    Delay (0.04) 
    Target.Interior.ColorIndex = xlNone 
    Delay (0.04) 
    Next n 
    End If 
    End Sub 
    
    Sub Delay(rTime As Single) 
    'delay rTime seconds (min=.01, max=300) 
    Dim oldTime As Variant 
    'safety net 
    If rTime < 0.01 Or rTime > 300 Then rTime = 1 
    oldTime = Timer 
    Do 
    DoEvents 
    Loop Until Timer - oldTime > rTime 
    End Sub
    So that if cell I54="Quarter End" then Cell F13 blinks? And if it doesn't = "Quarter End" then Cell B13 blinks? Also, can the blink last longer than a few seconds?

    Thanks

  10. #10
    Board Regular Drdave1958's Avatar
    Join Date
    Mar 2002
    Location
    Sitting here inside myself
    Posts
    204

    Default Re: Flashing Text

    Here is building on Phils code..........


    Code:
    Private Sub Worksheet_Change(ByVal Target As Range)
    If Range("I54").Value = "Quarter End" Then
    For n = 1 To 10
    Range("F13").Font.Color = vbRed
    Delay (0.25)
    Range("F13").Font.Color = vbWhite
    Delay (0.25)
    Next n
    ElseIf Range("I54").Value <> "Quarter End" Then
    For n = 1 To 10
    Range("B13").Font.Color = vbRed
    Delay (0.25)
    Range("B13").Font.Color = vbWhite
    Delay (0.25)
    Next n
    End If
    Range("F13,B13").Font.Color = vbBlack
    End Sub



    Adjust the numeric value in the "Delay" line to control how long it blinks.

    -Dave-

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