Sub ExampleCode()
Dim arNew() As String, Ws As Worksheet, ar As Variant, x As Integer
'This loop will check the availability of the sheets and load it in new array
For Each ar In Array("ScorePerformance_BB", "ScorePerformance_RCB", _
"ScorePerformance_CC", "ScorePerformance_RFS", _
"ScorePerformance_FTG", "ScorePerformance_MINVT", _
"ScorePerformance_CR", "Sheet1")
On Error Resume Next
Set Ws = Sheets(ar)
On Error GoTo 0
If Not Ws Is Nothing Then
ReDim Preserve arNew(0 To x)
arNew(x) = ar
x = x + 1
End If
Next ar
'Only Available Sheets Are loaded in arNew Array
For Each ar In arNew
MsgBox ar
Next ar
End Sub
Bookmarks