Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default show the current year

is there a way for a macro to insert the current year
into a cell. i have some formulas that calculate
holidays from an excel book, and they all have to refer
back to a cell containing the year. however when i tried
to put in a function such as =TODAY() in a cell and
formatted it as custom "yyyy" it still displays 1/13/04
and the formulas return a #NUM error. so i think a macro
might be able to just input "2004" into a cell somehow.
i have been playing with some VBA functions, but i am
sure that it is just something i havent learned yet.
TIA...spence
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default show the current year

Spence,

Try

=YEAR(TODAY())

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"spence" wrote in message
...
is there a way for a macro to insert the current year
into a cell. i have some formulas that calculate
holidays from an excel book, and they all have to refer
back to a cell containing the year. however when i tried
to put in a function such as =TODAY() in a cell and
formatted it as custom "yyyy" it still displays 1/13/04
and the formulas return a #NUM error. so i think a macro
might be able to just input "2004" into a cell somehow.
i have been playing with some VBA functions, but i am
sure that it is just something i havent learned yet.
TIA...spence



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
Current year and current week number Grey Old Man[_2_] Excel Discussion (Misc queries) 11 December 8th 09 06:30 PM
Always show Jan of current year Keyrookie Excel Worksheet Functions 2 December 2nd 09 04:44 PM
Finding the current year BrittaniMV Excel Worksheet Functions 3 May 15th 09 07:34 PM
Combination Graph with current year and prior year sales JanW Charts and Charting in Excel 2 April 5th 07 09:20 PM
How to compare current year to prior year in bar chart? substring Charts and Charting in Excel 4 May 12th 05 07:04 PM


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