Buenos días; me gustaría me ayuden a crear un macro que me realize un resumen de un libro de excel

este libro cotiene un total de 500hojas numeradas asi 0001-0002-0003...............0500
y la información que contiene esta ubicada en las siguientes filas y columnas C9:T9 Y C34:T34

1 respuesta

Respuesta
1

sube tu archivo desde http://www.programarexcel.com/p/contacto.html para ver archivo y te paso solución.

Ahí tienes el código que hace el resumen que quieres copia las celdas c9 t9 de todas las hojas y c4 t 34 de todas las hojas.

Private Sub HaceResumen()
'On Error Resume Next
Application.ScreenUpdating = False
Dim hoja As Worksheet
Dim x, i, fila, fila1 As Integer
If Sheets(1).Name <> "Resumen" Then
Sheets.Add Before:=Worksheets(1)
ActiveSheet.Name = "Resumen"
Else
Sheets(1).Cells.ClearContents
Sheets(1).Select
End If
x = Sheets.Count
fila = 9
fila1 = 10
For i = 2 To x
Sheets(i).Range("E6").Copy Destination:=Sheets("Resumen").Range("C" & fila)
Sheets(i).Range("D9:T9").Copy Destination:=Sheets("Resumen").Range("D" & fila & ":T" & fila)
Sheets(i).Range("O2").Copy Destination:=Sheets("Resumen").Range("C" & fila1)
Sheets(i).Range("N34:T34").Copy
Sheets("Resumen").Range("N" & fila1 & ":T" & fila1).PasteSpecial Paste:=xlValues
fila = fila + 2
fila1 = fila1 + 2
Next i
Sheets("Resumen").Columns("C:T").Select
With Selection
.RowHeight = 12.75
.Interior.Pattern = xlNone
.Interior.TintAndShade = 0
.Interior.PatternTintAndShade = 0
.Font.Name = "Arial"
.Font.Size = 12
.Font.Bold = False
End With
Sheets("Resumen").Range("C:T").EntireColumn.AutoFit
Application.ScreenUpdating = True
End Sub

Finaliza la pregunta.

Añade tu respuesta

Haz clic para o

Más respuestas relacionadas