Hello, I have following code to copy the sheets in the closedbook array to "thisworkbook", I've tried a few different ways. How can I fix this?
VBA Code:
Dim wb As Workbook
Set wb = ThisWorkbook
Dim ws As Worksheet
Dim Matched As Boolean
Dim ArrayOne() As Variant
ArrayOne = Array("Summary Analysis", "Detail Summary Analysis")
For Each ws In closedbook.Worksheets
Matched = False
For Each wsName In ArrayOne
If wsName = ws.Name Then
Matched = True
Exit For
End If
Next
[B][SIZE=5]'this is where the issue is: "Object doesn't support this property"[/SIZE][/B]
[SIZE=5] If Matched Then
closedbook.ws(ArrayOne).Copy After:=wb.ws(Sheets.Count)
End If[/SIZE]
Next ws
VBA Code: