I'm a bit stumped by this one, I created a simplified version of your code for testing:
The first problem it hits is that when there's a date in A1 Excel doesn't recognise it as being a numeric, so that line needs to be changed to:
The code then works fine so long as there's a genuine date in cell A1. In fact the only error I can generate is if A1 contains a string which looks like a date. This seems to slip through the IsDate test, but then throws a type mismatch error when I try to subtract 90 from it.
Is that what you're seeing?
Bookmarks