Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default Year showing 1899 instead of 2009

How do I get the following to give me 2009 instead of 1899 in immediate window?

? Year(today)
produces 1899 rather than 2009


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Year showing 1899 instead of 2009

TODAY is a worksheet function, not a VB one. Use either one of these
instead...

? Year(Now)

? Year(Date)

--
Rick (MVP - Excel)


"Bob Zimski" wrote in message
...
How do I get the following to give me 2009 instead of 1899 in immediate
window?

? Year(today)
produces 1899 rather than 2009



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 88
Default Year showing 1899 instead of 2009

Debug.Print Year(Now)

HTH,

Eric

"Bob Zimski" wrote:

How do I get the following to give me 2009 instead of 1899 in immediate window?

? Year(today)
produces 1899 rather than 2009


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,549
Default Year showing 1899 instead of 2009

Or try...
?year([today()])
--
Jim Cone
Portland, Oregon USA


"Bob Zimski"

wrote in message
How do I get the following to give me 2009 instead of 1899 in immediate window?

? Year(today)
produces 1899 rather than 2009


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 595
Default Year showing 1899 instead of 2009

On Mon, 23 Feb 2009 13:48:35 -0500, "Rick Rothstein"
wrote:

TODAY is a worksheet function, not a VB one. Use either one of these
instead...

? Year(Now)

? Year(Date)


In addition, under VBE - Tools - Options, check Require Variable
Declaration. That way VBA would not try to interpret 'today' as a variable.
And it's just good practice.
--
Dick Kusleika
Microsoft MVP-Excel
http://www.dailydoseofexcel.com
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
change date format year to another (e.g., from 1/2/2010 to 1/2/2009) Roger317 Excel Discussion (Misc queries) 1 October 4th 10 08:29 AM
Copy from one worksheet to another changes the year from 2009 to 2 Peter Edwards Excel Discussion (Misc queries) 2 November 12th 09 01:34 PM
how to calculate $1000/year at 5% for 25 years showing each year HELP! Setting up and Configuration of Excel 0 July 25th 06 12:58 AM
Cell won't accept date past year 2009 lbrown New Users to Excel 2 February 15th 06 01:51 PM
Excel cut/paste prob: Adds one day and changes year to 2009 Maisha1908 Excel Discussion (Misc queries) 3 February 7th 05 07:19 PM


All times are GMT +1. The time now is 03:56 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"