title: Find/replace macro that properly formats a date cell
body: <p>I'm using an app that exports certain data to a CSV format. The date column, however, is not properly format in the raw data and contains unnecessary trailing characters for the year, which prevents Excel from interpreting it correctly once imported.</p>
  
  <p>If I manually run Find and Replace on the column, the values are automatically recognized as dates. If I record the operation as a macro, however, and run it again, the trailing character is removed, but the data in the column is retained as a text, not as a date.</p>
  
  <p>Here's the VBA code:</p>
  
  <pre><code>Sub formatDate()
  
  Columns("A:A").Select
  Selection.Replace What:=" г.", Replacement:="", LookAt:=xlPart, _
      SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
      ReplaceFormat:=False
  End Sub
  </code></pre>
  
  <p>The regional format for a date is <code>DD.MM.YYYY</code>. Also, if I simply edit any of the resulting cells (F2) and hit Enter without anything else, Excel switches to the proper format.</p>
  
  <p>Sample data:</p>
  
  <pre><code>4 март 2017 г.
  4 март 2017 г.
  3 март 2017 г.
  1 март 2017 г.
  28 февруари 2017 г.
  27 февруари 2017 г.
  27 февруари 2017 г.
  26 февруари 2017 г.
  26 февруари 2017 г.
  </code></pre>