title: Convert text to columns in Excel using VBA
body: <p>I'm trying to convert text to columns using a macro but I'm not able to do it, I have tried to record a macro to achieve this, however I'm running into some issues since the text to columns VBA function expects a selection, is there a way I can dinamically chose let's say range A7:A50000? or even better A7:lastnonempty cell?</p>
  
  <p>Thanks,</p>
  
  <p>FYI, the delimeter is not important since I need to do this to convert text into formula</p>
  
  <p>Here is my code</p>
  
  <pre><code>Range("O6").Select
  Range(Selection, Selection.End(xlDown)).Select
  Selection.TextToColumns Destination:=Range("O6"), DataType:=xlDelimited, _
      TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
      Semicolon:=False, Comma:=False, Space:=False, Other:=False, FieldInfo _
      :=Array(1, 1), TrailingMinusNumbers:=True
  </code></pre>