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