Wasn’t sure what the subject of this thread should have been!
I have the following code:
Dim ws As Worksheet
For Each ws In Worksheets(Array(“Smith Pipe”, “Smith Fcst”, “Cole Pipe”, “Cole Fcst”, “Flock Pipe”, “Flock Fcst”))
ws.Activate
With ActiveSheet
End With
Next ws
The worksheets are created from another set of code based on the data in my spreadsheet. The problem is that sometimes I do not have all 6 of those spreadsheets. Sometimes I will only have “Smith Pipe”, “Flock Fcst” & “Cole Pipe” in my workbook.
So what occurs is that I get an error when it goes to the worksheets that I have named in the above code.
Is there someway to say – If worksheet does not exist go on to next one in array?
Thanks!