View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
colin_e colin_e is offline
external usenet poster
 
Posts: 5
Default Range.Copy only works with a named destination parameter?

Having an odd problem with the Range.Copy method.

This code:

Set source= Range("VL_Source")
Set target = VL.Offset(1).Resize(1, 1)
source.Copy Destination:=target

works fine. However the same thing with positional parameter:

Set source= Range("VL_Source")
Set target = VL.Offset(1).Resize(1, 1)
source.Copy (target)

fails with the error-

Run-time error '1004':
Copy methid of Raneg class failed

As far as I can see they mean exactly the same thing (source and target are
both declared as type Range). Any idea why this happens?

Regards; Colin