Johnny Thunder
Well-known Member
- Joined
- Apr 9, 2010
- Messages
- 693
- Office Version
- 2016
- Platform
- MacOS
Anyone ever see these kinds of issues?
My code executes just fine and quickly in excel 2010 but errors out on one line in Excel 2016?
*Please forgive the archaic selects all over this code, I didn't write it but I have already re-written but the error still occurs on the same line.
Specific Error: Runtime Error 1004
Autofilter method of range class Failed
Code
My code executes just fine and quickly in excel 2010 but errors out on one line in Excel 2016?
*Please forgive the archaic selects all over this code, I didn't write it but I have already re-written but the error still occurs on the same line.
Specific Error: Runtime Error 1004
Autofilter method of range class Failed
Code
Code:
Sub ByCostCenterCopyPast()
Application.DisplayAlerts = False
Application.ScreenUpdating = False
TimeStamp
Sheets("Query Results").Visible = True
Sheets("Query Results").Select
Range("AR1:AR9").Select
Selection.Copy
Range("AS1:JG9").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Calculate
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("A12:AF12").Select
Selection.Copy
Range("A13:AF10000").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Calculate
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("JS12:KA12").Select
Selection.Copy
Range("JS13:KA10000").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Calculate
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("A13").Select
Application.CutCopyMode = False
Sheets("Query Results").Visible = False
Sheets("PARAMETERS").Select
Range("V57:Y58").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("By Cost Center").Select
Range("A4:D5").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
ActiveSheet.PivotTables("PivotTable3").PivotCache.Refresh
ActiveSheet.Range("$A$10:$CD$652").AutoFilter '<------------------------------------------------------------------ Error line
ActiveSheet.Range("$A$10:$CD$652").AutoFilter Field:=5
Range("A12:E12").Select
Selection.Copy
Range("A13:E652").Select
Selection.PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Range("G12:CD12").Select
Selection.Copy
Range("G13:CD652").Select
Selection.PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Calculate
Range("A13:E13").Select
Range(Selection, Selection.End(xlDown)).Select
Application.CutCopyMode = False
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("G13:CD13").Select
Range(Selection, Selection.End(xlDown)).Select
Application.CutCopyMode = False
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("C2").Select
Application.CutCopyMode = False
ActiveSheet.Range("$A$10:$CD$652").AutoFilter Field:=5, Criteria1:="<>"
Sheets("PARAMETERS").Select
Range("AH59").Select
Selection.Copy
Sheets("Summary by Quarter").Select
Range("B4").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("PARAMETERS").Select
Range("W57:X57").Select
Selection.Copy
Sheets("Summary").Select
Range("B6:C6").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("BPC Hierarchy by Cost Center").Select
UpdateBPChierarchyReport
Sheets("By Ter-Dep-BU-Cst-Com-Pft").Select
By_Ter_BU_Dep_Flat_File
Sheets("PARAMETERS").Select
Range("v28").Select
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub
Last edited: