Is it possible for you to have a separate column which will state the file names from where the data should come from? Then the looping can happen easily.