Crear reportes y guardarlos en otro archivo diferente al que contiene los datos
Tengo una macros en excel que me crea reportes de evaluaciones en las hojas del mismo archivo. Necesito que estos reportes se creen en otro archivo, y tenga la opción de elegir donde guardar el archivo creado.
la macros:
Sub informes()
'por luismondelo
Sheets("ResultadoS").Select
Range("a2").Select
Do While ActiveCell.Value <> ""
ActiveCell.Copy
Sheets("plantilla").Range("b4").PasteSpecial Paste:=xlValues
Range(ActiveCell.Offset(0, 1), ActiveCell.Offset(0, 16)).Copy
Sheets("plantilla").Range("c7").PasteSpecial Paste:=xlValues, Transpose:=True
Range(ActiveCell.Offset(0, 17), ActiveCell.Offset(0, 20)).Copy
Sheets("plantilla").Range("c25").PasteSpecial Paste:=xlValues, Transpose:=True
Range(ActiveCell.Offset(0, 21), ActiveCell.Offset(0, 24)).Copy
Sheets("plantilla").Range("c31").PasteSpecial Paste:=xlValues, Transpose:=True
Range(ActiveCell.Offset(0, 25), ActiveCell.Offset(0, 27)).Copy
Sheets("plantilla").Range("c37").PasteSpecial Paste:=xlValues, Transpose:=True
Range(ActiveCell.Offset(0, 28), ActiveCell.Offset(0, 31)).Copy
Sheets("plantilla").Range("c42").PasteSpecial Paste:=xlValues, Transpose:=True
Sheets("plantilla").Copy after:=ActiveWorkbook.Worksheets(ActiveWorkbook.Sheets.Count)
ActiveSheet.Name = Left(Range("b4").Value, 30)
Sheets("Resultados").Select
ActiveCell.Offset(1, 0).Select
Loop
Sheets("plantilla").Select
Range("b4").ClearContents
Range("c7:c22").ClearContents
Range("c25:c28").ClearContents
Range("c31:c34").ClearContents
Range("c37:c39").ClearContents
Range("c42:c45").ClearContents
Sheets("Resultados").Select
Range("a1").Select
End Sub.Gracias por leer la preguntas.
1 Respuesta
Respuesta de Lucas Rios
1
