title: Excel VBA - Sheets(Arrary("Sheet2","Sheet3")) using a variable for sheet names
body: <p>I want to code the following</p>
  
  <p>Sheets(Arrary("Sheet2","Sheet3")).Select, by creating a variable for the sheet names to replace the "Sheet2","Sheet3".</p>
  
  <pre><code>Sub SelectMultipleSheets()
  
    Dim sSheets as String
    Dim intSheet As Integer
  
      sSheets = ""
  
      For intSheet = 1 To Sheets.count
  
          If Sheets(intSheet).Name &lt;&gt; "Sheet1" And intSheet &lt;= Sheets.count Then
  
              Sheets(intSheet).Cells.Hyperlinks.Delete 'deleting hyperlinks
  
              sSheets = sSheets &amp; Chr(34) &amp; Sheets(intSheet).Name &amp; Chr(34) &amp; ","
  
          End If
  
      Next
  
      sSheets = Left(sSheets, Len(sSheets) - 1)
      Sheets(Array(sSheets)).Select
  
  End Sub
  </code></pre>
  
  <p>I get an error message "Subscript not in range. How do I fix this? Thanks</p>