I am try to write a macro to open up several files and look for a particular sheet. If the sheet is found to copy it over another workbook. However, my dilemma comes when that sheet is not found/available. Is there a way to write into the macro to move to the next workbook if the sheet is not found?
This is what I got so far. Any suggestion is appreciated.
Windows("Book2").Activate
Sheets("Sheet2").Select
Sheets("Sheet2").Copy After:=Workbooks("Book1").Sheets(3)
Windows("Book3").Activate
Sheets("Sheet2").Select
Sheets("Sheet2").Copy After:=Workbooks("Book1").Sheets(4)
This is what I got so far. Any suggestion is appreciated.
Windows("Book2").Activate
Sheets("Sheet2").Select
Sheets("Sheet2").Copy After:=Workbooks("Book1").Sheets(3)
Windows("Book3").Activate
Sheets("Sheet2").Select
Sheets("Sheet2").Copy After:=Workbooks("Book1").Sheets(4)