title: Excel VBA Passing Range to Function yields 424: Object Required
body: <p>I am trying to pass a range to a function and getting Run-time error 424: Object required.</p>
  
  <p>Here is the function:</p>
  
  <pre><code>Function TextToCol(myRange As Range)
  
      myRange.TextToColumns Destination:=myRange, DataType:=xlDelimited, _
      TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=False, _
      Semicolon:=False, Comma:=False, Space:=True, Other:=False, FieldInfo _
      :=Array(1, 1), DecimalSeparator:=".", ThousandsSeparator:=",", _
      TrailingMinusNumbers:=True
  
  End Function
  </code></pre>
  
  <p>And here is the sub where I'm trying to use it:</p>
  
  <pre><code>Sub Test()
  
      Dim wschar              As Worksheet
      Dim rng                 As Range
  
      Set wschar = ThisWorkbook.Worksheets("Charges")
  
      Set rng = wschar.Range("A1")
  
      TextToCol (rng)
  
  End Sub
  </code></pre>
  
  <p>I've tried this several different ways and can't figure out why it won't accept my range.</p>
  
  <p>This is the line it highlights in yellow as not passing:</p>
  
  <pre><code>TextToCol (rng)
  </code></pre>