Rapidez de macro, va muy lenta
Tengo esta macro, pero a la hora de ejecutarla tarda mucho tiempo en realizar lo que tiene que hacer, ya que tiene ver la información en más de 90 libros de excel, ¿se podría hacer algo para que fuera más rápido?
Sub Resumen()
'Por.D
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Set l1 = ThisWorkbook
Set h1 = l1.Sheets("Resumen")
h1.Rows("2:" & Rows.Count).Clear
'
ruta = "C:\x\"
ruta = ThisWorkbook.Path & "\"
arch = Dir(ruta & "*.xls*")
hoja = "IVA 3T"
j = 2
Do While arch <> ""
If arch <> l1.Name Then
Set l2 = Workbooks.Open(ruta & arch)
existe = False
For Each h In l2.Sheets
If UCase(h.Name) = hoja Then
existe = True
Exit For
End If
Next
If existe = True Then
Set h2 = l2.Sheets(hoja)
For i = 37 To 1002
If h2.Cells(i, "R") <> "" Then
h2.Rows(i).Copy h1.Rows(j)
h1.Cells(j, "AA") = h2.Range("D1")
j = j + 1
End If
Next
End If
l2.Close False
End If
j = j + 1
arch = Dir()
Loop
Application.ScreenUpdating = False
MsgBox " Resumen terimado ", vbInformation, "RESUMEN"
End Sub
1 Respuesta
Respuesta de Jaime Segura
1
