title: Passing a Worksheet to a subroutine
body: <p>I have the following code:</p>
  
  <pre><code>Private Sub SortWorksheet(ByVal sheet As Worksheet)
      Dim sStartColumn
      Dim iTopRow
      Dim sEndColumn
      Dim iBottomRow
      Dim Rng As Range
      Dim sRange1 As String
      .
      .
      .
  </code></pre>
  
  <p>and I am calling the function like so:</p>
  
  <pre><code>SortWorksheet (DestSheet)
  </code></pre>
  
  <p>I am getting a runtime error on the above line saying "Object doesn't support this property or method"</p>
  
  <p>DestSheet is a worksheet variable.</p>
  
  <p>Why is this code not working?</p>