+ Reply to Thread
Results 1 to 4 of 4

Macro won't work in 2007

  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

    Please Login or Register  to view this content.
    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.

  2. #2
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: Macro won't work in 2007

    Your post does not comply with Forum Rule #3 regarding the use of code tags for VBA code. Please amend your post to add the code tags, after which solutions will be suggested.

    Rule #3
    Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # button at the top of the post window. If you are editing an existing post, press Go Advanced to see the # button. For more information about these and other tags, click here.
    Palmetto

    Do you know . . . ?

    You can leave feedback and add to the reputation of all who contributed a helpful response to your solution by clicking the star icon located at the left in one of their post in this thread.

  3. #3
    Forum Contributor
    Join Date
    02-14-2007
    Location
    Chester, England
    MS-Off Ver
    2010 & 2016
    Posts
    312

    Re: Macro won't work in 2007

    Hi Mate

    The only time I get this error is when one of the cells does not contain a date or time but is populated.

    E.g. I just put the letter "a" in one cell and that is when I got the error.

    It could be more to do with the data than the macro. as it runs fine on my version of Excel

    Hope this helps

    Cheers

    Jim

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Macro won't work in 2007

    Further to the prior post and in response to your earlier assertion of debug at:

    Please Login or Register  to view this content.
    the above would occur were the value an Error

    To correct both issues you could perhaps change the above to:

    Please Login or Register  to view this content.

+ 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