+ Reply to Thread
Results 1 to 1 of 1

Need Help With Flashing Cell Macro

Hybrid View

  1. #1
    Registered User
    Join Date
    03-22-2004
    Posts
    20

    Need Help With Flashing Cell Macro

    Have the following macro below that I found on the interweb that I would like to refine. Basically looking for the macro to run automatically when the workbook is first launched. Also, if I have multiple values throughout multiple cells that I want the macro to work on, could that be accommodated somehow? For instance, if A1>4, but also if A5>25, etc? Thanks in advance mates.


    Private Sub Flash_Cells() 
    
    Dim FlashColor As Integer 
    Dim MakeFlash As Range 
    Dim x As Integer 
    Dim TheSpeed 
    Dim i 
    
    'Just a random range of cells. Change it to whatever you want. 
    Set MakeFlash = Range("A1") 
    
    For Each i In MakeFlash 
    
    If i.Value > 4 Then 
    
    FlashColor = 3 'Set the color to red 
    
    'Make the cell range flash fast: 0.01 to slow: 0.99 
    TheSpeed = 0.2 
    
    'Flash 7 times 
    Do Until x = 7 
    
    DoEvents 
    Start = Timer 
    Delay = Start + TheSpeed 
    Do Until Timer > Delay 
    DoEvents 
    MakeFlash.Interior.ColorIndex = FlashColor 
    Loop 
    Start = Timer 
    Delay = Start + TheSpeed 
    Do Until Timer > Delay 
    DoEvents 
    MakeFlash.Interior.ColorIndex = xlNone 
    Loop 
    x = x + 1 
    Loop 
    
    End If 
    Next i 
    
    End Sub
    Last edited by Leith Ross; 06-23-2011 at 02:10 AM. Reason: Added Code Tags

+ Reply to Thread

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