Page 1 of 1

### Help in understanding table.copyrange

Posted: Thu Jan 18, 2018 7:08 am
Hi,

I would like to copy the range of one table to another using a loop.

tableT_{%a}_{%x}_{%j}.copyrange A2 N23 tableALL A2 ;

the first table will get copied into tableALL at A2 , the second will be at A2+ 22 ( number of row inserted = 22)

Can I used the following formula in my loop.

number of columns in tableT = c = 14
number of rows in tableT = r = 22

tableT_{%a}_{%x}_{%j}.copyrange 1 1 c r tableALL (1+ i)

Any help will be greatly appreciated.

Thanks

### Re: Help in understanding table.copyrange

Posted: Thu Jan 18, 2018 9:46 am
Copyrange unfortunately does not take expressions. So you will have to precalculate the source row and column as well as the destination row.

Here is an example:

Code: Select all

`!c=24!r=22' copy 4 tables to tableAllfor !i=0 to 3   !dest_r = (!i*!r) + 2   tableT_{%a}_{%x}_{%j}.copyrange 1 1 !r !c tableAll !dest_r 1next`

### Re: Help in understanding table.copyrange

Posted: Thu Jan 18, 2018 10:45 am
Thanks alots, it's working.