Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
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





  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default Adding Days not years?

CORRECTION.
My mistake.

As i had an IF statement, i placed it in the option 2 and the option 1 was
selected and thus didi not work.

You code works greate TOM.
Thank you.

"Coza" wrote in message
...
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







Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
converting days to years & months & days oldLearner57 Excel Discussion (Misc queries) 4 October 2nd 09 01:57 PM
how do i convert a number of days to years, months & days? SafetyLen Excel Discussion (Misc queries) 1 August 23rd 07 01:34 AM
Convert years to years and days Kimmie B Excel Discussion (Misc queries) 3 February 7th 06 08:06 PM
convert Days to Years, Months, Days Klaudebou Excel Discussion (Misc queries) 3 December 29th 05 10:33 PM
Convert # of days to years/days Marlene Mayer Excel Discussion (Misc queries) 3 April 27th 05 02:27 AM


All times are GMT +1. The time now is 10:07 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"