Is there a way to automatically reference filenames in Calc?

I have a spreadsheet that combines data from other sheets. I use a formula similar to this:


I have 50 files ranging from myfile01.csv to myfile50.csv. Is there a way to automatically let Calc change the number from 1, 2, 3, …, 50? I have a column (A) that has all these numbers and thought it could be possible to reference it somehow, but I didn’t find anything. I am thinking about something like:


I am using Win 7, LO Calc v.

Assuming a file name part is in cell A1 you could try something like DOSOMETHING(INDIRECT("'file:///C:/Users/User/myfile" & A1 & ".csv'#$myfile" & A1 & ".AB$2:AB$1000"))

However, massive use of the INDIRECT() function may slow recalculation down (50 is not massive fwiw). And of course, since the AB$2:AB$1000 reference would be a string then, there’s no automatic adjustment of the reference when pulling or copying the formula cell.

Works like a charm, thanks!