Hi, I have some macros to copy range values to other locations, but the ranges are dynamic and sometimes I need to do an operation on the data.
Lets say I need to copy Range("A1:A10") to Range("C1:C20"). (notice the destination range is larger).
So I have:
myArray = Range("A1:A10")
Loop for operation on array.
Range("B1:B20") = myArray.
This works but the Range("C11:C20🙂 becomes populated with N/A causing errors and possibly delegating data.
If I copy paste in excel, then only range C1:C10 is affected.
Is there a way to have VBA not cause errors when pasting to larger ranges?
Thanks
Lets say I need to copy Range("A1:A10") to Range("C1:C20"). (notice the destination range is larger).
So I have:
myArray = Range("A1:A10")
Loop for operation on array.
Range("B1:B20") = myArray.
This works but the Range("C11:C20🙂 becomes populated with N/A causing errors and possibly delegating data.
If I copy paste in excel, then only range C1:C10 is affected.
Is there a way to have VBA not cause errors when pasting to larger ranges?
Thanks