Macro super lenta, es mi código o mi maquina
Resulta que he sacado un código de alguna macro por allí para ayudarme en una tarea, en el archivo original trabaj rápido, pero en mi libro es muy lenta, 4-8 segundos para cumplir su trabajo, adjunto
******************
Sub Add_dbProductListSales()
'
' Add_dbProductListSales Macro
'
'
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Application.EnableEvents = False
ActiveSheet.DisplayPageBreaks = False
Sheets("dbListSales").Select
Range("A3:J3").Select
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromRightOrBelow
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlInsideVertical)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
Range("C3").Select
Sheets("dbSales").Select
Range("F5").Select
Selection.Copy
Sheets("dbListSales").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("dbSales").Select
Range("F3").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("dbListSales").Select
Range("D3").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("dbSales").Select
Range("D7:D8").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("dbListSales").Select
Range("E3").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=True
Range("G3").Select
Sheets("dbSales").Select
Range("C12:F12").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("dbListSales").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("B3").Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = _
"=IF(AND(RC[1]=dbSales!R[2]C[4],'dbListSales'!RC[1]='dbListSales'!R[1]C[1]),SUM('dbListSales'!R[1]C+1),""1"")"
Range("B3").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("A3").Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = "=RC[2]&RC[1]"
Range("A3").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Sheets("dbSales").Select
Range("C12").Select
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
Application.EnableEvents = True
ActiveSheet.DisplayPageBreaks = True
Application.CutCopyMode = False
End Sub