22
Pruebe o verifique si la hoja existe
Dim wkbkdestination As Workbook Dim destsheet As Worksheet For Each ThisWorkSheet In wkbkorigin.Worksheets 'this throws subscript out of range if there is not a sheet in the destination 'workbook that has the same name as the current sheet in the origin workbook. Set destsheet = wkbkdestination.Worksheets(ThisWorkSheet.Name) Next Básicamente, recorro todas …