Copying and pasting values error 1004

  • Thread starter Thread starter alistair01
  • Start date Start date
A

alistair01

Whenever i run this piece of code i get the error
"paste method of worksheet class failed" runtime error 1004
This is in excel 2003 and i did not have this problem in 2000. Coul
anyone shed any light on this??

Range("A1").Select
Sheets("atl").Select
Range("A1").Select
Selection.AutoFilter Field:=9
Selection.AutoFilter Field:=8
Selection.AutoFilter Field:=11
Selection.AutoFilter Field:=9, Criteria1:="1"

Selection.AutoFilter Field:=13, Criteria1:="3"
Columns("J:J").Select

Range("J:J,B:B").Select
Selection.Copy
Sheets("Alarm Type-Door").Activate
Range("a1").Select
ActiveSheet.Paste
Columns("A:A").EntireColumn.AutoFit
Columns("B:B").EntireColumn.AutoFit
Range("A1").Select

When i enter the vb editor the line activesheet.paste is highlighte
which i presume is where the error is
 
i cannot provide a solution, as i am at a computer with xl 2000, right
now.

some functionalities have changed between xl 2000 and the following
version.

i can suggest a solution.

record a macro in which you simple copy something from one sheet onto
another. compare the code with your code, this will give you an idea as
to what is the correct syntax for 'paste'.
 
try removing your un-necessary selections.
with Sheets("Alarm Type-Door")
Range("J:J,B:B").Copy .Range("a1")
..columns("A:b").EntireColumn.AutoFit
end with
 
Back
Top