title: Change Text to Date with VBA TextToColumns
body: <p>Edit: VBA code now is working. Was just and .currentregion that messed it up for me</p>
  <p>I have an issue, that is hopefully just some silly mistake from myside.
  I have a dataset that I get at least once a day with the dates not recognised as date, but as normal text.
  I would like to have this column changed to date with a VBA macro.
  The code I have written now, just gives me an error message, and I can not figure out what is wrong.</p>
  <p>This is how the file looks, I could not figure out how to attach the file...</p>
  <p><a href="https://i.stack.imgur.com/mKbOO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mKbOO.png" alt="enter image description here" /></a></p>
  <p>And here is my code</p>
  <pre><code>Sub Test()
  
  Dim rg As Range
  Set rg = Range(&quot;B2:B4&quot;)
  rg.TextToColumns Destination:=Range(&quot;B2:B5&quot;), ConsecutiveDelimiter:=True, DataType:=xlDelimited, Space:=True, FieldInfo:=Array(Array(1, 5))
  
  End Sub
  </code></pre>
  <p>Any suggestion what might be wrong with the code or how I can make it work?
  The date format is YMD when I do this in the Text to Columns in excel itself.
  This is a part of a bigger VBA, so it would be much easier to do it as a VBA than to do it manually every time I need it.</p>