Page 1 of 1

Putting a loop on the "range" specification

Posted: Tue Mar 10, 2015 4:26 am
by davey87
Hello,

I have to export data from a workfile to an excel file with 120 different tabs. I am wondering if there is a way to put a loop on within the "range" specification, specifically to loop through the excel sheet number. It doesn't seem to be working for me. For example:

Code: Select all

for !i=1 to 120 pagesave(type=excel, mode=update, noid) "file.xls" range="Sheet{!i}!c3:ad122" nonames na=" " byrow @keep aios{!i} next
Any suggestions would be appreciated.

Thanks

Re: Putting a loop on the "range" specification

Posted: Tue Mar 10, 2015 7:56 am
by EViews Gareth

Code: Select all

for !i=1 to 120 %sheet = "sheet" + @str(!i) + "!c3:ad122" pagesave(type=excel, mode=update, noid) "file.xls" range=%sheet nonames na=" " byrow @keep aios{!i} next