The new forums will be named Coin Return (based on the most recent
vote)! You can check on the status and timeline of the transition to the new forums
here.
The Guiding Principles and New Rules
document is now in effect.
Pulling data from spreadsheets without set cells
This is more of a general question for something I may have to do in the near future. Say you get monthly spreadsheets from many sources and the cells you need to pull from could move around from month to month. What would be the best way to pull the data from these? Would VBA be capable of something like this? Is there a better way of dealing with spreadsheets that I'm not aware of?
0
Posts
If the headers are least consistent you should be able to look them up that way.
Alternatively, try to fix the upstream process if at all possible.
I guess I'm mainly curious if there's a way to find a cell based on the location of another cell and do that for many sheets with different references. Say something like cell D4 in one book says "Growth" and E4 has the data I need, and the next month those are in D5 and E5. And then another sheet has "Value" and the data is in the cell under it.
Yeah, I mean it is absolutely possible to solve this problem if there is some kind of relative consistency; but you may need to eyeball the data to find it.
You could make a sheet of translation keys for different data arrangments (if they're extremely different, such as Growth's label not always being the same relative offset to it's value, or not being consistently labeled at all), but you would still need them to have a finite variance. If their relative layout is also changing month to month and not merely source to source, that key may be impossible to maintain, and Tofystedeth's recommendationof fixing the upstream process (or simply preprocessing) may be necessary.
That is what I'm hoping, but I think there are like 90+ of these, each from a different source, so I'm not confident.