title: Transpose a range in VBA
body: <p>I am Trying to Transpose a range of cells in Excel through VBA macro but I am getting some errors, mostly Error 91. </p>
  
  <p>I am pretty new to VBA and don't have much idea about functions either.</p>
  
  <pre><code>Range(InRng).Select
  Set Range1 = Selection
  Dim DestRange As Range
  Set DestRange = Application.WorksheetFunction.Transpose(Range1)
  </code></pre>
  
  <p>After going through a couple of forums, this is what I have come up with. One thing to note is that I don't have to copy them into any other cells. </p>
  
  <p>What I am trying to achieve is to create a co-variance method and in the option window the user will have the option to select the range and then choose either by columns or rows, this will then affect the resulting covariance matrix.</p>