Error 1004 Macro excel
Hola,
Tengo este codigo y me da error 1004 en tiempor de ejecucion
Private Sub CommandButton1_Click()
Application.ScreenUpdating = False
Sheets("Ordenar").Select
Range("A1:AT305").Select
Selection.ClearContents
Sheets("Detalle").Activate
Range("AB6:AT305").Select
Selection.Copy
Sheets("Ordenar").Activate
Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Range("A1:AT300").Select
Selection.Sort Key1:=Range("F1"), Order1:=xlDescending, Key2:=Range("G1") _
, Order2:=xlAscending, Key3:=Range("M1"), Order3:=xlAscending, Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal, DataOption2:=xlSortNormal, DataOption3:= _
xlSortNormal
Sheets("Ordenar").Activate
Range("B1:Z300").Select
Selection.Copy
Sheets("Detalle").Activate
Range("B6").Select
Selection.PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Sheets("Ordenar").Activate
Range("AN1:AN300").Select
Selection.Copy
Sheets("Detalle").Activate
Range("AN6").Select
Selection.PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Sheets("Ordenar").Activate
Range("AQ1:AR300").Select
Selection.Copy
Sheets("Detalle").Activate
Range("AQ6").Select
Selection.PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Sheets("Filtro").Activate
Selection.AutoFilter Field:=3, Criteria1:="1", Operator:=xlAnd
Range("D3").Select
MsgBox "Proceso Finalizado correctamente..." & vbCrLf & vbCrLf, vbInformation, "Informacion"
Application.ScreenUpdating = True
End Sub
Tengo este codigo y me da error 1004 en tiempor de ejecucion
Private Sub CommandButton1_Click()
Application.ScreenUpdating = False
Sheets("Ordenar").Select
Range("A1:AT305").Select
Selection.ClearContents
Sheets("Detalle").Activate
Range("AB6:AT305").Select
Selection.Copy
Sheets("Ordenar").Activate
Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Range("A1:AT300").Select
Selection.Sort Key1:=Range("F1"), Order1:=xlDescending, Key2:=Range("G1") _
, Order2:=xlAscending, Key3:=Range("M1"), Order3:=xlAscending, Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal, DataOption2:=xlSortNormal, DataOption3:= _
xlSortNormal
Sheets("Ordenar").Activate
Range("B1:Z300").Select
Selection.Copy
Sheets("Detalle").Activate
Range("B6").Select
Selection.PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Sheets("Ordenar").Activate
Range("AN1:AN300").Select
Selection.Copy
Sheets("Detalle").Activate
Range("AN6").Select
Selection.PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Sheets("Ordenar").Activate
Range("AQ1:AR300").Select
Selection.Copy
Sheets("Detalle").Activate
Range("AQ6").Select
Selection.PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Sheets("Filtro").Activate
Selection.AutoFilter Field:=3, Criteria1:="1", Operator:=xlAnd
Range("D3").Select
MsgBox "Proceso Finalizado correctamente..." & vbCrLf & vbCrLf, vbInformation, "Informacion"
Application.ScreenUpdating = True
End Sub
1 Respuesta
Respuesta de calvuch
1