I am using the following code to determine if a cell in a range contains a date, and if so to act by adding 100 years to the date:
For Each c In Range("A88:A130")
If IsDate(c.Value) And DatePart("yyyy", c.Value) < "2000" Then c.Value = DateAdd("yyyy", 100, c.Value)
Next c
It seems to work fine if the cells have a date or are empty, but it crashes if any of the cells contain anything other than a date, such as spaces or text. How can I fix this? Any help will be greatly appreciated. Thanks.
Bookmarks