Thread: Copy Method
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Copy Method

Probably because mysht is not the active sheet and the Cells property points
to the active sheet. Try

mySht.Range(mySht.Cells(5, 1), mySht.Cells(endRow, 1)).Copy


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Rowan" wrote in message
...
I was just wondering why this line of code works:

mySht.Range("A5:A" & endRow).Copy

while this one produces runtime error 1004

mySht.Range(Cells(5, 1), Cells(endRow, 1)).Copy

Regards
Rowan