title: VBA array length (not ubound or onerror!)
body: <p>Sorry to ask such a basic question but this is driving me mad...</p>
  
  <p>What function in VBA returns the number of elements in an array... i.e when the array is empty it will return 0?</p>
  
  <p>I cant do this with UBound because it throws an error when called on an empty array and i cant believe the way to do this by using OnError to first determine if its empty or not... as is suggested on forums! array.Length complains about a bad qualifier or something. </p>
  
  <p>I really need to do this:</p>
  
  <pre><code>dim termAry() as String
  populate termAry
  ...
  
  private sub populate(terms() as String)
     redim preserve terms(terms.Length) ' Redim takes ubound for array size
     terms(ubound(terms)) = "something really annoying"
  end sub
  </code></pre>
  
  <p>P.S any good links to a concise set of VBA language and function reference would be most useful... MSDN seems really obscure!!!</p>