Putting a loop on the "range" specification

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt

davey87
Posts: 24
Joined: Tue Feb 05, 2013 12:18 pm

Putting a loop on the "range" specification

Postby davey87 » Tue Mar 10, 2015 4:26 am

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

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13604
Joined: Tue Sep 16, 2008 5:38 pm

Re: Putting a loop on the "range" specification

Postby EViews Gareth » Tue Mar 10, 2015 7:56 am

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


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests