Run time error 1004 select method of worksheet class failed

Aaron DeYoung

New Member
Joined
Apr 23, 2014
Messages
12
I a, a newer VBA user and I am having trouble running a Recorded and 'somewhat cleaned up' script. The following is part of what I have and Bold and Italicized is the problem part that keeps popping up with the Run time error 1004. I have tried an array of different things, but nothing has worked. Any help would be greatly appreciated. Thanks in advance!

Selection.AutoFill Destination:=Range("I2:I4223"), Type:=xlFillDefault
Range("I2:I4223").Select
Columns("I").Select
Selection.NumberFormat = "mm/dd/yyyy"
Columns("R").Select
Selection.NumberFormat = "mm/dd/yyyy"

Range("M2").Select
ActiveCell.FormulaR1C1 = _
"=VLOOKUP(RC[-12],'Prior Month Training Report'!R[1]C[-12]:R[4218]C[5],13,FALSE)"
Selection.AutoFill Destination:=Range("M2:R2"), Type:=xlFillDefault
Range("M2:R2").Select
Selection.AutoFill Destination:=Range("M2:R4223"), Type:=xlFillDefault
Range("M2:R4223").Select



ActiveSheet.AutoFilterMode = False
ActiveSheet.Range("$A$1:$R$4223").AutoFilter

Rows("1:1").Select
Range("H1").Activate
ActiveSheet.Range("$A$1:$R$1").AutoFilter Field:=9, Criteria1:=Array( _
"#N/A"), Operator:=xlFilterValues, Criteria2:=Array(0, "1900")



Range("I2").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.ClearContents
ActiveSheet.Range("$A$1:$R$4223").AutoFilter Field:=9
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.

Forum statistics

Threads
1,223,214
Messages
6,170,772
Members
452,353
Latest member
strainu

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