I have found the answer to most of my question by reviewing past posts, but one thing in particular still eludes me.
The basics. I am changing a “legacy” spreadsheet which contains over a hundred sheets (each representing an Operating Location) – each sheet linking to a different spreadsheet (in some cases more than one) on a network drive. Each month this “destination” spreadsheet would be updated with an Edit-Find-Replace to change all the links’ directories to the current month. Lots of problems with this process – which I will not go into.
The change I am attempting is to list every Operating Location on ONE page and write a macro to extract the data from the appropriate file and place the DATA ONLY into the correct cell on the new spreadsheet. Essentially, creating one table of all the data instead of massive spreadsheet with hundreds of links.
The solutions that I have found all deal with how to find/get the data on a one-to-one basis from a known single source to a known destination; some even handle this problem on a many-to-many basis. My problem is I have over a hundred potential many-to-one issues, and I do not know how to handle the error checking.
The Issue. For each Operating Location there on occasion may be up to THREE different sources for the data (which must be combined). This was handled in the OLD VERSION with a manual review of the source file directory and an update to the destination’s link formula to include more than one source (e.g., =’S:….[source1.xls]Total’!B1 + ‘S:….[source2.xls]Other’!E4, etc.) – yuck!
What I would like to do is for each Operating Location search for all 3 possible files; skip those sources that do not exist (without blowing up the macro); and sum the appropriate data for sources that do exist; and place that sum into my new table. The three possible source files for each are ######finpkg.xls, ######MEDHS.xls and ######finpkg2.xls; where ###### is the six-digit identifier for the Operating Location.
Thanks in advance for any help, or a pointer to a post I may have overlooked.