+ Reply to Thread
Results 1 to 1 of 1

Make a cell blink by it's entered time plus 2 hours

Hybrid View

  1. #1
    Registered User
    Join Date
    11-07-2014
    Location
    Kansas City
    MS-Off Ver
    2007
    Posts
    1

    Make a cell blink by it's entered time plus 2 hours

    If I have a time value in cell A1 as 00:00, how can I use VBA to make the cell blink when the current time is 2 hours greater than A1, and stop when cell has no value or empty? Here is the homework I've done. I've never really messed with VBA so forgive my ignorance. Maybe I can use a variation of this, editing the "If Range("A1") = "1" in the code?

    MODULE
    Option Explicit 
    Public RunWhen As Double 
    
    Sub StartBlink() 
        If Range("A1").Interior.ColorIndex = 3 Then 
            Range("A1").Interior.ColorIndex = 6 
        Else 
            Range("A1").Interior.ColorIndex = 3 
        End If 
        RunWhen = Now + TimeSerial(0, 0, 1) 
        Application.OnTime RunWhen, "StartBlink", , True 
    End Sub 
    
    Sub StopBlink() 
        Range("A1").Interior.ColorIndex = xlAutomatic 
        Application.OnTime RunWhen, "StartBlink", , False 
    End Sub
    CODE

    Option Explicit 
    Public CellCheck As Boolean 
    
    Private Sub Worksheet_Change(ByVal Target As Excel.Range) 
    
         'Change the IF statement and cell range to what you need
        If Range("A1") = "1" And CellCheck = False Then 
            Call StartBlink 
            CellCheck = True 
        ElseIf Range("A1") <> "1" And CellCheck = True Then 
            Call StopBlink 
            CellCheck = False 
        End If 
    
    End Sub
    Last edited by clogik; 11-07-2014 at 09:23 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Make cell blink
    By Oziebill in forum Excel General
    Replies: 3
    Last Post: 06-14-2012, 06:14 PM
  2. Working out hours between date in a cell and the current time
    By MasonSinclair in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-19-2011, 06:06 AM
  3. Can you make a cell blink?
    By raven_guy in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 02:05 AM
  4. [SOLVED] Can you make a cell blink?
    By raven_guy in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 AM
  5. [SOLVED] Make a cell blink
    By JenML5 in forum Excel General
    Replies: 1
    Last Post: 04-21-2005, 11:06 AM

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