title: function to choose column vector from square matrix
body: <p>Hi there I'm new to VBA and have created a few basic functions but the following is proving too advanced. </p>
  
  <p>I want to create a function which converts a square matrix into one of its columns. </p>
  
  <pre><code>      colA  colB   colC
  [1,]   1      2      3
  [2,]   4      5      6
  [3,]   7      8      9
  </code></pre>
  
  <p>So getcol(A1:C3,2) would output:</p>
  
  <pre><code>2
  5
  8
  </code></pre>
  
  <p>I'm not sure if it's possible to output a range from a function. </p>
  
  <p>It's to be used in an array Match function, so: </p>
  
  <pre><code>{Index(G1:G3,Match(2&amp;2,getcol(A1:C3)&amp;getcol(D1:F3),0))}
  </code></pre>
  
  <p>The code I've tried, which I'm sure makes no sense, is:</p>
  
  <pre><code>Function getcol(a As Range, b As Integer) As Range
  getcol = Range(a).EntireColumn(b)
  End Function
  </code></pre>