+ Reply to Thread
Results 1 to 3 of 3

Blink/Flash multiple cells Code almost done but stuck up with array error

Hybrid View

  1. #1
    Registered User
    Join Date
    05-22-2011
    Location
    chennai
    MS-Off Ver
    Excel 2003
    Posts
    71

    Blink/Flash multiple cells Code almost done but stuck up with array error

    HI

    I try codedone excel file that will blink if the date in the E column is greater that 4 from todays date. I almost done the code but stuck up with array code " arCellsToBlink(iCounter) = "Sheet1!E" & j " and below is the complete code

    Option Explicit
    
    Public CellCheck As Boolean
    Public RunWhen As Double
    Dim j As Integer
    Dim i As Integer
    Dim arCellsToBlink()
    Dim iCounter As Integer
    Dim lastrow As Integer
    
    Public Sub dter()
    
    Dim startdate
    Dim enddate
    Dim das
    'Dim j As Integer
    
    lastrow = ThisWorkbook.Sheets(1).Cells(Rows.Count, 5).End(xlUp).Row
     ReDim arCellsToBlink(0 To lastrow)
    For i = 2 To lastrow
    
    startdate = ThisWorkbook.Sheets(1).Range("E" & i).Value
    enddate = Now()
    
    startdate = Format(startdate, "mm-dd-yyyy")
    enddate = Format(enddate, "mm-dd-yyyy")
    'MsgBox startdate & "   " & enddate
    
    das = Application.WorksheetFunction.NetworkDays(enddate, startdate)
    
    If das = 1 Then
    ThisWorkbook.Sheets(1).Range("E" & i).Interior.ColorIndex = xlNone
    Else
    If das = 2 Then
    ThisWorkbook.Sheets(1).Range("E" & i).Interior.ColorIndex = 6
    Else
    If das = 3 Then
    ThisWorkbook.Sheets(1).Range("E" & i).Interior.ColorIndex = 3
    Else
    If das >= 4 Then
    ThisWorkbook.Sheets(1).Range("E" & i).Interior.ColorIndex = 3
    j = i
    arCellsToBlink(iCounter) = "Sheet1!E" & j
    'arCellsToBlink(iCounter) = "Sheet1!E7"
    iCounter = iCounter + 1
    Call StartBlink
    
    CellCheck = True
    
    End If
    End If
    End If
    End If
    Next
    End Sub
    
    
    Sub StartBlink()
     For iCounter = 0 To lastrow
            If arCellsToBlink(iCounter) <> "" Then
        If ThisWorkbook.Sheets(1).Range("E" & j).Interior.ColorIndex = 3 Then
            ThisWorkbook.Sheets(1).Range("E" & j).Interior.ColorIndex = 6
        Else
            ThisWorkbook.Sheets(1).Range("E" & j).Interior.ColorIndex = 3
        End If
         End If
        Next iCounter
        
        
        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


    Thanks
    Thiru
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor Sadath31's Avatar
    Join Date
    03-02-2011
    Location
    Dammam, Saudi Arabia
    MS-Off Ver
    Office 365
    Posts
    452

    Re: Blink/Flash multiple cells Code almost done but stuck up with array error

    Hi,
    run the macro 'Stop Blink' to stop blinking
    Option Explicit

    HTML Code: 

  3. #3
    Registered User
    Join Date
    05-22-2011
    Location
    chennai
    MS-Off Ver
    Excel 2003
    Posts
    71

    Re: Blink/Flash multiple cells Code almost done but stuck up with array error

    Quote Originally Posted by Sadath31 View Post
    Hi,
    run the macro 'Stop Blink' to stop blinking
    Option Explicit

    HTML Code: 
    Thank You

    Thanks
    Thiru

+ 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. how can i get a cell to flash or blink
    By Lee K in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-26-2006, 11:27 PM
  2. How do I make a border flash, blink or otherwise?
    By DWALLACE in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 10:05 AM
  3. How do I make a border flash, blink or otherwise?
    By David McRitchie in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-06-2005, 04:05 AM
  4. How do I make a border flash, blink or otherwise?
    By DWALLACE in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 01:05 AM
  5. How do I make a border flash, blink or otherwise?
    By DWALLACE in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 10:05 PM

Tags for this Thread

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