title: Convert string variable to date
body: <p>I need to convert a string variable to a date variable in a VBA macro, to process the date to get the mMonth and year in order to name the worksheet</p>
  
  <pre><code>Call GetMonthandYear(MonthYear, FileDate)
      ActiveSheet.Name = MonthYear
  </code></pre>
  
  <p>I looking to create a method called GetMonthandYear. FileDate is a String in a date format, <code>dd.MM.yyyy HH-mm-ss</code>. If I can change the variable to a date, I can change the format to <code>MMMM/yyyy</code> and then use <code>ToString</code>, I think, and assign it to <code>MonthYear</code>.</p>
  
  <p>Is there a way to change the string to a date?</p>