Hi, below you can see a part of my code that will do stuff with a workbook so long as it is an xls file. The code searches for the sheet named 'quote' and then does stuff to that sheet. I would like to change the code to skip the file if the workbook does not have the page 'quote'.
Another feature I'd like added but is not necessary is the possibility for the sheet to be under a different name other than quote such as 'penguin'. Ideally, I'd like a small list of names the sheet could be. Of course though, if you don't know of the top of your head then don't bother with it.
Thanks in advance
Code:
If InStr(1, CodeNames(i, 1), ".xls") > 0 Then If Not WorkbookOpen(CStr(Split(CodeNames(i, 1), "\")(UBound(Split(CodeNames(i, 1), "\"))))) Then
Set wbTarget = Workbooks.Open(CodeNames(i, 1))
With wbTarget.Worksheets("Quote")
ary(0) = .Range("B7")
ary(1) = .Range("B8")
ary(2) = .Range("B11")
ary(3) = .Range("B13")
End With
Else
Another feature I'd like added but is not necessary is the possibility for the sheet to be under a different name other than quote such as 'penguin'. Ideally, I'd like a small list of names the sheet could be. Of course though, if you don't know of the top of your head then don't bother with it.
Thanks in advance