title: Selecting all elements in Array
body: <p>I'm trying to select all Sheets that correspond to conditional in Array but the code don't work.</p>
  <pre><code>Dim arr() As String
  
  y = Sheets.Count
  
  cont = 1
  arrInit = 0
  
  For i = 1 To y
  
      Sheets(i).Activate
      If ActiveSheet.Range(&quot;a1&quot;) &lt;&gt; &quot;&quot; Then
          cont = cont + 1
          ReDim Preserve arr(1 To cont)
          arrInit = arrInit + 1
          Name = ActiveSheet.Name
          arr(arrInit) = Name
      End If
  
  Next i
  </code></pre>