The first thing I did was choose one of the functions and add a stop statement to the top. Then it would enter debug mode (for each copy of the function. I ended up deleting most references to the functions so that I didn't need to wade through all of the instances of the function.) While in debug mode, I could step through the function and found that it errored (without warning or message) on:
What this statement is doing is checking if Ccell contains a date and if the year of that date is the same as yr. When Ccell.value is a number or a string that can be interpreted as a date (or empty where the value is interpreted to be the number 0), these tests work just fine. When Ccell.value is a text string that cannot be interpreted as a date, the Year() function errors.
What I think you will need to do is separate these into separate, nested If..Then statements.
This way, when Ccell is not a date formatted cell, then it can skip over the Year() function and avoid the runtime error.
Bookmarks