Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default My on-going problems with dates

OK,
Trying another aproach.
Textbox4.text = Date (23 March 2007)
Textbox11.value = 2
Whay does this code:
Range("D2").Text = DateAdd("y", TextBox11.Value, TextBox4.Text)

NOT ADD Years(Textbox11.value = "2") ?
It ADD's 2 Days to the date instead ???


Corey....


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default My on-going problems with dates

Don't use this. y = Day of year, not years
Mydate = DateAdd("y", 2, "23 March 2007")
Use this instead to add two years.
Mydate = DateAdd("yyyy", 2, "23 March 2007")

"Coza" wrote:

OK,
Trying another aproach.
Textbox4.text = Date (23 March 2007)
Textbox11.value = 2
Whay does this code:
Range("D2").Text = DateAdd("y", TextBox11.Value, TextBox4.Text)

NOT ADD Years(Textbox11.value = "2") ?
It ADD's 2 Days to the date instead ???


Corey....



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
Between dates. Two problems Obonden Excel Discussion (Misc queries) 4 January 21st 09 10:32 PM
My on-going problems with dates Coza Excel Programming 3 March 23rd 07 09:04 AM
Problems with dates? skint Excel Discussion (Misc queries) 1 October 8th 06 11:51 PM
problems with dates Nikki Q Excel Discussion (Misc queries) 4 May 25th 06 09:11 AM
problems with dates before 1900 lalohg Excel Programming 3 June 11th 04 07:01 PM


All times are GMT +1. The time now is 03:21 AM.

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"