Well I was thinking about it last night, and I'm just not sure it can be done outside of VBA. I threw together some code, but it's very limited because it cannot adapt to changing situations.
This is where I'm hoping I can get some assistance making the code adaptable to changing variables and levels.
What I have assumes I have 3 gold builders, in 3 set rows. This will change. Somebody could drop from Gold to Silver, making 2 Gold, somebody could go from Silver to Gold, making 4 Gold. I could have somebody entirely new be added making more than 7 people.
What I'm thinking is this. I always have a count of how many people there are of each type, using a CountIf, defined in my sheet by the name CountGold, CountSilver, etc. If I could use these numbers to define X amount of Variables for Gold, X amount for Silver, and so on... I could adapt my code to suit. The next step would be to find which rows have "Gold" in them, which would allow me to find where to A) get the Limit and B) record the Allocations.
Edit: I think I know what needs to be done, I just have no idea how.
If I understand Arrays correctly (And I'm not sure that I do) I could define an Array of CountGold by (for my argument) 3 which would then contain
A) The Row that it is found in
B) The limit
and C) the Allocation
I could then define my code so that For i to CountGold, I add 1 to Array part C, then move to the next Array part C. Once that's done, record Array part C in each Cells(4, Array Part A)
Is that right, or am I nuts?
Any thoughts?
Thanks again,
-Bob
Bookmarks