Loading
Ozgrid Excel Help & Best Practices Forums

Excel Video Tutorials / Excel Dashboards Reports



Results 1 to 6 of 6

Thread: Blinking text VB code

  1. #1
    Join Date
    28th July 2006
    Posts
    5

    Blinking text VB code

    Hello,

    I'm working on setting up a report template for my manager, who is a very visual person. I'm trying to make certain values within the report more noticable by color change and flashing/blinking. I've been looking online for VBE code that causes flashing/blinking cells when cell conditions change. I've attempted using some code I was able to find and tried to manipulate it to fit my needs, however, I have not been able to get it to work.

    I'm trying to get the text (not the background color) within a range (i.e.K11:K31) to flash continuously based on the cells value. The cells in question are linked to cells on another workbook which is updated on occasion.

    Values may be as follows:

    AP
    F-Avoidable
    F-Unavoidable
    P
    RC
    ON

    Cells in the range K11:K31 are linked to a similar cell range on another worksheet (i.e. the formula used is: =IF(Datasource1!K15=0," ",Datasource1!K15) ).

    The problem I keep running into with the code I've found are as follows:

    1. Due to the values in K11:K31 being the result of a formula, the values/cells are not flashing.

    2. The flashing is not continuous (i.e. everything I've found so far has a time limit). I have been able to manipulate the code to extend the amount of time the flashing occurs, but so far I've been unsuccessful in causing it to loop infinitely.

    3. All of the code I've found so far causes the background rather than the text to flash (this is a minor issue, more of a preference on my part)..


    Would anyone out there have any suggestions?

    Thanks in advance for any help.

    Excel Video Tutorials / Excel Dashboards Reports


  2. #2
    Join Date
    26th January 2003
    Location
    Derbyshire,UK
    Posts
    17,878

    Re: Blinking text VB code

    I don't know what code you have, but you should find .Interior.ColorIndex that can be changed to .Font.ColorIndex to change the Font colour.
    Hope that Helps

    Roy

    For free Excel tools & articles visit my web site

    If I have helped you and you feel like putting your hand in your pocket please make a donation to Children in Need

    RoyUK's Web Site

    royUK's Database Form

    Where to paste code from the Forum

    About me.

  3. #3
    Join Date
    28th July 2006
    Posts
    5

    Re: Blinking text VB code

    This is the only piece I could actually get to work as written. However, when I went to edit it to fit my needs, I wasn't able to do so in order to get it to work. I'm having trouble getting it to work with the following criteria:


    -A cell range (i.e. K11:K31)
    -multiple values/flashing a different color for each value (i.e. AP - red, F-Avoidable - green, F-Unavoidable - blue, ON - violet, L - Orange, etc.)
    -functioning where the value is the result of a formula within the cell (i.e. the formula in K11 on the worksheet is as follows: =IF(Datasource1!K15=0," ",Datasource1!K15) )
    -the blinking is continuous, rather than ending after a few seconds

    VB:
    Private Sub Worksheet_Change(ByVal Target As Range) 
         'Test the value of the specified cell
        If Target.Address = "$A$3" Then 
            If Target.Value >= 12 Then Call Blinker(Target) 
        End If 
    End Sub 
    Public Sub Blinker(ByVal rng As Range) 
         'Causes the cell "rng" to blink 100 times
        Dim myCounter As Integer 
        Do Until myCounter = 100 
            With rng.Interior 
                If .ColorIndex = 6 Then 
                    .ColorIndex = xlNone 
                Else 
                    .ColorIndex = 6 
                End If 
                Pause (0.2) 
                myCounter = myCounter + 1 
            End With 
        Loop 
    End Sub 
     
    Public Sub Pause(ByVal dblSecs As Double) 
         'Pauses the execution of code for the specified number of seconds
        Dim Start 
        Start = Timer 
        Do While Timer < Start + dblSecs 
            DoEvents 
        Loop 
    End Sub 
    
    
    Last edited by royUK; July 28th, 2006 at 03:51.

    Excel Video Tutorials / Excel Dashboards Reports


  4. #4
    Join Date
    26th January 2003
    Location
    Derbyshire,UK
    Posts
    17,878

    Re: Blinking text VB code

    Please remember to use Code tags when posting code.
    Hope that Helps

    Roy

    For free Excel tools & articles visit my web site

    If I have helped you and you feel like putting your hand in your pocket please make a donation to Children in Need

    RoyUK's Web Site

    royUK's Database Form

    Where to paste code from the Forum

    About me.

  5. #5
    Join Date
    28th July 2006
    Posts
    5

    Re: Blinking text VB code

    Sorry about that.

    Excel Video Tutorials / Excel Dashboards Reports


  6. #6
    Join Date
    26th January 2003
    Location
    Derbyshire,UK
    Posts
    17,878

    Re: Blinking text VB code

    Have a look at this earlier post, it might help.
    Hope that Helps

    Roy

    For free Excel tools & articles visit my web site

    If I have helped you and you feel like putting your hand in your pocket please make a donation to Children in Need

    RoyUK's Web Site

    royUK's Database Form

    Where to paste code from the Forum

    About me.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Possible Answers

  1. Stop Blinking When ScrollBar Has Focus
    By John Nevill in forum EXCEL HELP
    Replies: 1
    Last Post: October 25th, 2007, 10:29
  2. Row Highlight and Blinking Cell
    By FloggingDolphin in forum EXCEL HELP
    Replies: 1
    Last Post: July 4th, 2005, 08:16
  3. Simulate a blinking cursor
    By JJacob in forum EXCEL HELP
    Replies: 2
    Last Post: June 9th, 2005, 16:53
  4. Blinking Cells?
    By KarenJ in forum EXCEL HELP
    Replies: 3
    Last Post: March 21st, 2003, 05:20

Bookmarks

Posting Permissions

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