Run Tme Error '1004' Delete Method of Range Class Failed

Laybenet

New Member
Joined
Apr 2, 2011
Messages
8
Hi Asking,

File I created the same Macro in Excel 2010 and it works fine but when I try to recreate it with Excel 2003, I get the following error:

Run Tme Error '1004'
Delete Method of Range Class Failed.

Here is the code:

Sub Transfers()
Application.ScreenUpdating = False
Sheets("Request").Select
Range("Req").AutoFilter Field:=32, Criteria1:="Approved"
Range("Z1").Select
ActiveCell.FormulaR1C1 = "=SUBTOTAL(3,R[4]C[-25]:R[9999]C[-25])"
If Range("Z1") = 0 Then
Selection.AutoFilter
Range("A5").Select
Else
Range("=OFFSET(Request!$A$4,1,0,COUNTA(OFFSET(Request!$A$4,1,0,9999)),34)").Select
Selection.SpecialCells(xlCellTypeVisible).Select
Selection.Copy
Sheets("In Progress").Select
Range("A65536").End(xlUp).Offset(1, 0).Select
Selection.PasteSpecial Paste:=xlPasteValues
Sheets("Request").Select
If Range("Z1") > 0 Then
Range("=OFFSET(Request!$A$4,1,0,COUNTA(OFFSET(Request!$A$4,1,0,9999)),32)").Select
Selection.SpecialCells(xlCellTypeVisible).Select
Selection.Rows.Delete
End If
Selection.AutoFilter
Range("A5").Select
End If
'This section you need to input your criteria for shifting to sheet Processed.
'Change the AutoFilter field if criteria is in different column to column 'R' (18)
Sheets("In Progress").Select
Range("Prog").AutoFilter Field:=33, Criteria1:="Completed"
Range("Z1").Select
ActiveCell.FormulaR1C1 = "=SUBTOTAL(3,R[4]C[-25]:R[9999]C[-25])"
If Range("Z1") = 0 Then
Selection.AutoFilter
Range("A5").Select
Else
Range("=OFFSET('In Progress'!$A$4,1,0,COUNTA(OFFSET('In Progress'!$A$4,1,0,9999)),34)").Select
Selection.SpecialCells(xlCellTypeVisible).Select
Selection.Copy
Sheets("Processed").Select
Range("A65536").End(xlUp).Offset(1, 0).Select
Selection.PasteSpecial Paste:=xlPasteValues
Range("A5").Select
Sheets("In Progress").Select
Range("Z1").Select
ActiveCell.FormulaR1C1 = "=SUBTOTAL(3,R[4]C[-25]:R[9999]C[-25])"
If Range("Z1") > 0 Then
Range("=OFFSET('In Progress'!$A$4,1,0,COUNTA(OFFSET('In Progress'!$A$4,1,0,9999)),34)").Select
Selection.SpecialCells(xlCellTypeVisible).Select
Selection.Rows.Delete
End If
End If
ActiveSheet.AutoFilterMode = False
Range("A5").Select
Sheets("Request").Activate
Application.CutCopyMode = False
Application.ScreenUpdating = True
End Sub

Any Suggestion?
<!-- / message -->
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.

Forum statistics

Threads
1,214,643
Messages
6,120,702
Members
448,980
Latest member
CarlosWin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top