View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Norman Jones Norman Jones is offline
external usenet poster
 
Posts: 5,302
Default Macro to copy cell contents number of columns

Hi Pierre,

Assuming that "rows to the right" is a typo and that your examples represent
your intentions, try:

Set rng = Range("A2")
rng.Offset(rng(0).Value).Value = rng.Value

---
Regards,
Norman



"Pierre" wrote in message
om...
Am looking for a method to copy a cells contents a number of rows to
the right, that is defined by a number in an adjacent cell?
For instance:

In cell A1 is the number 5
In cell A2 is ABCD

I'd like ABCD to be copied to A7

If the value in cell A1 happens to be 4, the contents of A2 would be
copied to A6.

Its a head scratcher.

TIA for any thoughts.

Peter