View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Zone[_3_] Zone[_3_] is offline
external usenet poster
 
Posts: 373
Default Year date format

Activecell.Formula="=YEAR(B4)"

"mathel" wrote in message
...
I need to extract the year only in a cell from the date in another cell.
What I have tried is:

Range("J4").Select
ActiveCell.FormulaR1C1 = "=text(B4, "yyyy")"
Range("B3").Select

I get an error which reads: Compile error:
--
Linda