Good morning,
The code below copy / pastes values from one workbook to another for all identical sheet names. However, when the active workbook contains a sheet not found in the "past wb", an error occurs. How do you tell the code to skip that sheet and continue on to the next (ie "On Error Resume Next ws")??
Thank you!
The code below copy / pastes values from one workbook to another for all identical sheet names. However, when the active workbook contains a sheet not found in the "past wb", an error occurs. How do you tell the code to skip that sheet and continue on to the next (ie "On Error Resume Next ws")??
Thank you!
Code:
For Each ws In ActiveWorkbook.Worksheets
Sheets(ws.Name).Activate
Range("F30").Select
Workbooks(pastWBname).Sheets(ws.Name).Activate
For i = 1 To 7
Selection.Copy
Selection.Offset(, 2).Select
Windows(myWB.Name).Activate
ActiveCell.PasteSpecial xlPasteValues
ActiveCell.Offset(, 2).Select
Windows(pastWBname).Activate
Next i
Next ws