Results 1 to 2 of 2

Can't get cells to blink!

Threaded View

  1. #1
    Forum Contributor
    Join Date
    04-11-2012
    Location
    Canada
    MS-Off Ver
    Excel 2007 & 2010
    Posts
    100

    Can't get cells to blink!

    trying to make my schedule blink if there's an issue on the line...however, having a hard time coding that scenario...

    My goal is to loop through a list in my "Ranges" sheet which will then loop through my "Aerial View Line 2" sheet and make those cells blink.
    This is what i got so far, but can't get it to work. I know I am close tho...

    Option Explicit
    Public CellCheck As Boolean
    Public RunWhen As Double
     
    Private Sub Worksheet_Change(ByVal Target As Excel.Range)
        Dim rngloop1 As Range
        Dim i As Range
        Dim rngloop2 As Range
        Dim f As Range
        Dim LR As Integer
        LR = Sheets("Ranges").Cells(Rows.Count, "L").End(xlUp).Row
        Set rngloop1 = Sheets("Ranges").Range("L1:L" & LR)
        Set rngloop2 = Sheets("Aerial View Line 2").Range("B8:B9")
        For Each i In rngloop1
            On Error Resume Next
            For Each f In rngloop2
                On Error Resume Next
                If f.Value = i.Value And CellCheck = False Then
                    Sheets("Ranges").Range("X1").Value = f.Value
                    Sheets("Ranges").Range("X2").Value = i.Value
                    Call StartBlink
                    CellCheck = True
                ElseIf f.Value <> i.Value And CellCheck = True Then
                    Sheets("Ranges").Range("X1").Value = f.Value
                    Sheets("Ranges").Range("X2").Value = i.Value
                    Call StopBlink
                    CellCheck = False
                End If
            Next
        Next
    End Sub
    Option Explicit
    Public RunWhen As Double
    
    Sub StartBlink()
        If Sheets("Ranges").Range("X1").Interior.ColorIndex = 3 Then
            Sheets("Ranges").Range("X1").Interior.ColorIndex = 6
        Else
            Sheets("Ranges").Range("X1").Interior.ColorIndex = 3
        End If
        RunWhen = Now + TimeSerial(0, 0, 1)
        Application.OnTime RunWhen, "StartBlink", , True
    End Sub
    
    Sub StopBlink()
        Sheets("Ranges").Range("X1").Interior.ColorIndex = xlAutomatic
        Application.OnTime RunWhen, "StartBlink", , False
    End Sub
    Attached Files Attached Files
    Last edited by questionguy; 11-22-2012 at 02:15 PM.

Thread Information

Users Browsing this Thread

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

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1