Number of elements in a single dimension variant array in excel
<p>Is This code correct for determining the number of elements in a single dimension variant array in Excel VBA. Supposing I have a variant array named Array1 with k elements.</p>

<pre><code>Dim n as Integer
n = UBound(Array1)
</code></pre>