1.You can create an array and initialize it by reading the excel file.
2.you can then use system variable $ArrayColumns to get the last column of the array or excel , eg $ArrayColumns($varray$)$.
3. once you know the total count of cols(say n), you can loop through n times.