View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Coza Coza is offline
external usenet poster
 
Posts: 38
Default Adding Days not years?

Thanks for the Reply Tom,
BUT i STILL get the code adding DAYS and NOT years???


Corey


"Tom Ogilvy" wrote in message
...
Try:
Range("D2").Value = DateAdd("yyyy", Clng(TextBox11.Value),
cdate(TextBox4.Value))

I guess Range("D2").Text was for illustration since that would raise an
error.

? dateAdd("yyyy",3,Date)
03/23/2010

? dateAdd("yyyy",3,"11/22/1998")
11/22/2001


--
Regards,
Tom Ogilvy


"Coza" wrote:

Range("D2").Text = DateAdd("yyyy", TextBox11.Value, TextBox4.Value)

Why does this not add years?

Textbox11.value = "5"

Ctm