title: Extract Year from Date Using VBA in Excel
body: <p>I have an excel workbook with several sheets. What I need to do is transfer the year from a column in one sheet to another sheet. I can get the column to transfer over fine, but I can't get it to give me just the date. </p>
  
  <p>The date is in <code>dd-mon-yy</code> format (ex. <code>14-Jul-14</code>). What I need is to get it in <code>yyyy</code> (ex. <code>2014</code>). Any assistance would be great. </p>
  
  <p>The code I'm attempting is this, but it doesn't work. </p>
  
  <pre><code>[...]
  For I=5 to 5
      If Not TransferCol (5) = 0 Then
          Worksheets ("Results").Cells.(Row, StartColumn + I) = Worksheets("Program").Cells(RowTransfer, Year (TransferCol (5)))
          Exit Do
      End If
  Next
  [....]
  </code></pre>