Add visible cells of a range to array
<p>I am trying to get the values of the visible cells of a range into an array.</p>
<p>My code makes the array carry the values until the first non visible cell then stops.</p>
<pre><code>Public Function ListeMaschinen() As Variant

Dim Auswahl As Range

With Sheets(&quot;qry_TechnischesDatenblatt&quot;)
Set Auswahl = .Range(.Range(&quot;A2:B2&quot;), .Range(&quot;A2:B2&quot;).End(xlDown)).SpecialCells(xlCellTypeVisible)
End With

ListeMaschinen = Auswahl

End Function
</code></pre>
<p>If I select the range it shows all the cells I want marked.</p>
<pre><code>Auswahl.Select
</code></pre>