Results 1 to 4 of 4

Macro won't work in 2007

Threaded View

  1. #1
    Registered User
    Join Date
    07-25-2008
    Location
    Tennessee
    Posts
    3

    Macro won't work in 2007

    Hello,

    I created a macro awhile ago to perform a pretty simple function in Excel 2003. The macro just goes down two specified columns and if a date is entered it is checked against whatever today's date is. If today's date is past the entered date the cell turns red, otherwise the cell is green. The macro worked flawlessly in Excel 2003. However now in Excel 2007 whenever the macro run a Runtime Error 13 occurs. Here is the code

    Private Sub Worksheet_Change(ByVal Target As Range)
    Dim c As Range
    
    For Each c In Range("E3:E567,H3:H567")
        If c.Value <> "" Then
            If CDate(c.Value) < Now Then
                c.Interior.Color = vbRed
            Else
                c.Interior.Color = vbGreen
            End If
        End If
    Next c
    End Sub
    The error occurs at the

    If c.Value <> "" Then

    line and is noted with Error = 2015

    Thanks in advance for any advice!
    Last edited by dhughes5; 01-12-2010 at 11:34 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