Sub completo()
application.ScreenUpdating = False
application.DisplayAlerts = False
Sheets("MODULO AM").Select
Cells.Select
Selection.ClearContents
Range("C8").Select
Sheets("ROBOT").Select
Sheets("RESUMÉN AM").Select
Range("B10:E10").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.ClearContents
Range("C8").Select
Sheets("ROBOT").Select
Range("b2") = ActiveWorkbook.Name
Dim Libro As String
Libro = Range("b2").Value
Sheets("MODULO FI").Select
Range("B12").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Call SAP
Call SAP2
' am Macro
'
'
Workbooks.Open Filename:="d:\mis documentos\SAP\SAP GUI\ModuloAM.XLSX", ReadOnly:="True"
Range("A1:I1").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Windows(Libro).Activate
'WindowState
Sheets("MODULO AM").Select
Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("K30").Select
Sheets("TD").Select
Range("B9").Select
application.CutCopyMode = False
ActiveSheet.PivotTables("Resumen AM").PivotCache.Refresh
Range("A3:D3").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Sheets("RESUMÉN AM").Select
Range("B10").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("G19").Select
Windows("ModuloAM.XLSX").Activate
Range("J25197").Select
ActiveWindow.Close
Windows(Libro).Activate
' fi Macro
'
'
Workbooks.Open Filename:="d:\mis documentos\SAP\SAP GUI\ModuloFI.XLSX", ReadOnly:="True"
Rows("1:1").Select
Selection.AutoFilter
ActiveSheet.Range("$A$1:$F$191").AutoFilter Field:=1, Criteria1:="<>"
Range("A1:C1").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Windows(Libro).Activate
Sheets("MODULO FI").Select
Range("B11").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("E27").Select
Windows("ModuloFI.XLSX").Activate
Range("E112").Select
ActiveWindow.Close SaveChanges:=False
Windows(Libro).Activate
' dep Macro
'
'
Sheets("DEPREC_AMORT").Select
Range("B9:D9").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.ClearContents
Range("D11").Select
Workbooks.Open Filename:="d:\mis documentos\SAP\SAP GUI\CuadroActivos.XLSX", ReadOnly:="True"
Cells.Select
Selection.ClearOutline
Rows("1:1").Select
Selection.AutoFilter
ActiveSheet.Range("$A$1:$U$93").AutoFilter Field:=2, Criteria1:="E210700"
ActiveSheet.Range("$A$1:$U$93").AutoFilter Field:=2, Criteria1:="=E210700" _
, Operator:=xlOr, Criteria2:="=F119102"
Cells.Select
With Selection.Interior
.PatternColorIndex = xlAutomatic
.COLOR = 65535
.TintAndShade = 0
.PatternTintAndShade = 0
End With
ActiveSheet.Range("$A$1:$U$93").AutoFilter Field:=2
ActiveSheet.Range("$A$1:$U$93").AutoFilter Field:=2, Operator:= _
xlFilterNoFill
Range("B2:C2").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Windows(Libro).Activate
Range("B9").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Windows("CuadroActivos.XLSX").Activate
Range("M2").Select
Range(Selection, Selection.End(xlDown)).Select
application.CutCopyMode = False
Selection.Copy
Windows(Libro).Activate
Range("D9").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("E14").Select
Windows("CuadroActivos.XLSX").Activate
Range("F65").Select
ActiveWindow.Close SaveChanges:=False
Windows(Libro).Activate
application.WindowState = xlMinimized
application.ActiveWindow.WindowState = xlMaximized
Sheets("ROBOT").Select
'ThisWorkbook.RefreshAll
On Error Resume Next
application.ScreenUpdating = True
application.DisplayAlerts = True
'MsgBox "Proceso terminado"
End Sub
ASÍ ES COMO LO HICE