0 calificaciones0% encontró este documento útil (0 votos)
105 vistas1 página
This VBA macro loops through each worksheet in the active workbook, copies it to create a new workbook, saves that new workbook as a separate file using the worksheet name and file extension, and closes the new workbook, leaving only the original workbook open. The macro disables screen updating for improved performance and uses error handling to avoid issues if a worksheet name already exists as a file name.
Descripción original:
Macro Para Convertir Hojas de Excel en Libros Independientes
Título original
Macro Para Convertir Hojas de Excel en Libros Independientes
This VBA macro loops through each worksheet in the active workbook, copies it to create a new workbook, saves that new workbook as a separate file using the worksheet name and file extension, and closes the new workbook, leaving only the original workbook open. The macro disables screen updating for improved performance and uses error handling to avoid issues if a worksheet name already exists as a file name.
This VBA macro loops through each worksheet in the active workbook, copies it to create a new workbook, saves that new workbook as a separate file using the worksheet name and file extension, and closes the new workbook, leaving only the original workbook open. The macro disables screen updating for improved performance and uses error handling to avoid issues if a worksheet name already exists as a file name.
Dim ruta As String ruta = ThisWorkbook.Path Application.ScreenUpdating = False For Each hoja In Application.ThisWorkbook.Worksheets hoja.Copy On Error Resume Next ActiveWorkbook.SaveAs Filename:=ruta & "/" & hoja.Name & ".xlsx", _ FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False ActiveWindow.Close Next End Sub