runtime error 1004 paste method of worksheet class failed

mgar2668

New Member
Joined
Jan 13, 2016
Messages
1
Hi All!

I keep receiving an error when copying data over:
"runtime error 1004 paste method worksheet class failed" at ActiveSheet.Range

Rich (BB code):
 Sheets("Macro").Select    Cells.Select
    Range("A1").Select
    ActiveSheet.Range
    Columns("D:D").Select
    Selection.Insert Shift:=xlToRight
    Selection.Insert Shift:=xlToRight
    Selection.Insert Shift:=xlToRight
    Selection.Insert Shift:=xlToRight
    Selection.Insert Shift:=xlToRight
    Columns("C:C").Select
    Selection.TextToColumns Destination:=Range("C1"), DataType:=xlDelimited, _
        TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=True, Tab:=False, _
        Semicolon:=False, Comma:=False, Space:=True, Other:=True, OtherChar:= _
        "-", FieldInfo:=Array(1, 1), TrailingMinusNumbers:=True
    Cells.Select
    Selection.AutoFilter
    ActiveSheet.Range("$A$1:$S$16287").AutoFilter Field:=9, Criteria1:="QC"
    ActiveSheet.Range("$A$1:$S$16287").AutoFilter Field:=4, Criteria1:=Array( _
        "High", "Low", "Mid"), Operator:=xlFilterValues
    Columns("R:R").Select




End Sub

I'm extremely new to VBA so I would really appreciate any pointers.

Thanks!
MG
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
ActiveSheet.Range is an incomplete statement, just delete it... it should be used as a function and it returns a range object that you can work with in vba
 
Upvote 0
really annoying how you cant edit but i wanted to add... you use Range method like this...

Dim r as Range
Set r = ActiveSheet.Range("A1")

Now you can do stuff with cell A1, like, editing it's value for example...

r.Value = 1
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

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