I'm getting the run time error at the point of Auto fill code (noted in red below). I've used this code before with no issues. The Range seems to be defined correctly and the last row was defined earlier in the macro.
Sheets("DC_ORDER").Select
Range("G2").Select
ActiveCell.FormulaR1C1 = "=IF(RC[-3]<=RC[10],""ORDER"",""XXX"")"
Range("G2").Select
Selection.AutoFill Destination:=Range("G2:G" & Cells(Rows.Count, "A").End(x1Up).Row)
With ActiveSheet
LastRow = ActiveSheet.Cells(Rows.Count, "A").End(xlUp).Row
Range("A1:AN" & LastRow).Select
End With
Sheets("DC_ORDER").Select
Range("G2").Select
ActiveCell.FormulaR1C1 = "=IF(RC[-3]<=RC[10],""ORDER"",""XXX"")"
Range("G2").Select
Selection.AutoFill Destination:=Range("G2:G" & Cells(Rows.Count, "A").End(x1Up).Row)
With ActiveSheet
LastRow = ActiveSheet.Cells(Rows.Count, "A").End(xlUp).Row
Range("A1:AN" & LastRow).Select
End With