View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Papa Jonah Papa Jonah is offline
external usenet poster
 
Posts: 148
Default date calc returning #name?

I am trying to figure out what is wrong with my Else formula. The
"begrevdate" is the name of a cell which contains a date with format
"MM/DD/YY".
The intermediate window shows:
?lastdate
3/31/05
?begrevdate
12:00:00 AM

I don't understand why begredate is not returning a date when a date is
present in the cell.

The result of the code in the sheet is #name?

With Range("a" & numberrows + 2)
.NumberFormat = "0.00"
.Name = "revtime"
If ans = vbNo Then
'calculates review period based on real-time date
.FormulaR1C1 = "=(today()-begrevdate)/365"
Else: .Formula = "=(lastdate-begrevdate)/365"
End If
End With

Thanks for your thoughts