title: Copying & Pasting a Date Value in a VBA Macro
body: <p>I have written a macro to copy and paste several cell values from one worksheet to another. This has been successful on all fields except one containing a date value. </p>
  
  <p>For example when the cell contains '08-Jan-14' the pasted value is an integer '41647'. </p>
  
  <p>How do I ensure the pasted value received by the new worksheet will be in date format? </p>
  
  <pre><code>Sub place_data(Source As Worksheet, Destination As Worksheet, Optional WorkbookName As String,  
  Optional rowToWrite As Integer)
  
  Dim iSourceHeader As Integer
  Dim iCol As Integer
  Dim lSourceEnd As Long
  Dim lDestEnd As Long
  Dim rSource As Range
  Dim rDestination As Range
  Dim rngFrom As Excel.Range
  Dim rngTo As Excel.Range
  
  Set rngFrom = Workbooks(WorkbookName).Sheets(Source.Name).Range("D51")
  Set rngTo = ThisWorkbook.Sheets("Self Test Summary").Range("A" &amp; rowToWrite)
  
  rngFrom.Copy
  rngTo.PasteSpecial Paste:=xlValues
  </code></pre>