I'm not sure of your grid direction and grid structure (number of rows)?
You can use functions like AIG(Q1,0) in a constructed list to assist here. Certainly look up the HELP in Sawtooth Software by hitting the F1 key.
Also, as an alternative, if you insert this Perl script into a constructed list, that should give you the solution you desire ...
Begin Unverified Perl
for($i=1; $i<=18; $i++)
In the above Perl script, I have assumed your grid question is Q1 and it uses a parent list in the columns called Q1ColList. Please change these accordingly.