Consulting

Results 1 to 4 of 4

Thread: cell blinking

  1. #1

    cell blinking

    Dear expert

    I have report where the figure shd not be in (-), so when the cell having less than 0 value than then that cell blinking continuously
    don't want to use conditional formatting b'cos it change the cell color once but not blink

    is this possible

    using excel 2007

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Blinking is an awful thing to inflict upon a user. If I got a spreadsheet that did that I would refuse to use it. In some places it might even be against laws designed to protect people with disabilities.

    Don't do it!
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    ok
    tnx for updates...

  4. #4
    VBAX Guru Kenneth Hobs's Avatar
    Joined
    Nov 2005
    Location
    Tecumseh, OK
    Posts
    4,956
    Location
    I totally agree with xld. Howsoever, I also believe in letting the user decide to go against advice.

    To make the interior color blink for A1 if it is 1, then in a Module:
    [VBA]Option Explicit
    Public RunWhen As Double

    Sub StartBlink(cell As String)
    If Range(cell).Interior.ColorIndex = 3 Then
    Range(cell).Interior.ColorIndex = 6
    Else
    Range(cell).Interior.ColorIndex = 3
    End If
    RunWhen = Now + TimeSerial(0, 0, 1)
    Application.OnTime RunWhen, "'StartBlink """ & cell & """'", , True
    End Sub

    Sub StopBlink(cell As String)
    Range(cell).Interior.ColorIndex = xlColorIndexNone
    Application.OnTime RunWhen, "'StartBlink """ & cell & """'", , False
    End Sub[/VBA]

    Right click the sheet, View Code, and paste:
    [VBA]Option Explicit
    Public CellCheck As Boolean

    Private Sub Worksheet_Change(ByVal Target As Excel.Range)
    If Target.Address(False, False) <> "A1" Then Exit Sub
    If Range("A1") = "1" And CellCheck = False Then
    StartBlink "A1"
    CellCheck = True
    ElseIf Range("A1") <> "1" And CellCheck = True Then
    StopBlink "A1"
    CellCheck = False
    End If
    End Sub[/VBA]

Posting Permissions

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