SumIf from various files

User avatar
VegasNath
5StarLounger
Posts: 1185
Joined: 24 Jan 2010, 12:02
Location: Wales, UK.

SumIf from various files

Post by VegasNath »

I have attached a mock-up version of a sumif task that I need to complete from 48 different files. The files have different names and are in different locations. The files are password protected to gain entry. All of the data is laid out in the same fashion, but I need to bring it all together in a summary.

My guess is that I will need to open each of the files in order to generate the data, but how is the best way to change each column based on a different source file?

I would appreciate any advice that can be offered by way of the best approach to such a task.
You do not have the required permissions to view the files attached to this post.
:wales: Nathan :uk:
There's no place like home.....

User avatar
HansV
Administrator
Posts: 78601
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: SumIf from various files

Post by HansV »

If you'd try to do this with links, the whole thing would probably become impossibly slow. I'd write code to open each of the files in turn, get the values you need, and write them to the appropriate cells. You'd have to re-run the code if you need to update the values.

Alternatively, import the 48 sheets into one workbook.
Best wishes,
Hans

User avatar
VegasNath
5StarLounger
Posts: 1185
Joined: 24 Jan 2010, 12:02
Location: Wales, UK.

Re: SumIf from various files

Post by VegasNath »

HansV wrote:If you'd try to do this with links, the whole thing would probably become impossibly slow.
Agreed. I think that I will need to use formula's / links, but convert the links to values as I go.
HansV wrote:I'd write code to open each of the files in turn, get the values you need, and write them to the appropriate cells. You'd have to re-run the code if you need to update the values.
Probably the best option, but I'm not sure where to start with that.
HansV wrote:Alternatively, import the 48 sheets into one workbook.
I fear the size would be massive.
:wales: Nathan :uk:
There's no place like home.....

User avatar
HansV
Administrator
Posts: 78601
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: SumIf from various files

Post by HansV »

Perhaps a database would be better suited to your purpose.
Best wishes,
Hans

User avatar
VegasNath
5StarLounger
Posts: 1185
Joined: 24 Jan 2010, 12:02
Location: Wales, UK.

Re: SumIf from various files

Post by VegasNath »

I managed to do this by creating the entire setup based on one file and then using Edit | Links | Change Source, and converting the formulas to values as I went through the various files. Not ideal, but not as bad as I originally thought.

Thanks
:wales: Nathan :uk:
There's no place like home.....