I have a calculator built in Excel 2003 in which you select options from a drop-down menu, data is then gathered and calculated returning your total cost to produce that package of items. What I'd like is to cycle through all the combinations of this drop-down and automatically return the total unit cost to another cell.
I have already created a massive grid with all possible drop-down selections entered in a separate worksheet. Here is an example of one iteration of this, but obviously this needs to loop and the cell references need to offset with the move.
- Cell value for E8 of the worksheet entitled "Cost Calculator" needs to = the Cell value for G1 of the worksheet entitled "Costs"
- Cell value for E9 of the worksheet entitled "Cost Calculator" needs to = the cell value for A2 of the worksheet entitled "Costs"
- Cell value for E10 of the worksheet entitled "Cost Calculator" needs to = the cell value for B2 of the worksheet entitled "Costs"
- Cell value for E11 of the worksheet entitled "Cost Calculator" needs to = the cell value for C2 of the worksheet entitled "Costs"
- Cell value for E12 of the worksheet entitled "Cost Calculator" needs to = the cell value for D2 of the worksheet entitled "Costs"
- Cell value for E13 of the worksheet entitled "Cost calculator" needs to = the cell value for E2 of the worksheet entitled "Costs"
- Then the calculated result in cell E22 of the worksheet entitled "Cost Calculator" needs to be copied and the value pasted into G2 of the worksheet entitled "Costs".
Then the exact same thing needs to occur with 2 changes.
- Cell value for E8 of the worksheet entitled "Cost Calculator" needs to = the Cell value for H1 of the worksheet entitled "Costs" (offset by one column)
and the calculated result in cell E22 of the worksheet entitled "Cost Calculator" needs to be copied and the value pasted into H2 of the worksheet entitled "Costs" again offset by one column.
This needs to occur 21 times (including the initial time) with the same two offsets.
I'd be happy if that were the case and I can just run the macro for each row, but if it could also cycle down a row and continue running until it hit a blank cell that would be ideal. If that were to occur, after the 21 times across it needs to move down a row and would be the following:
- Cell value for E8 of the worksheet entitled "Cost Calculator" needs to = the Cell value for G1 of the worksheet entitled "Costs" (will always be in row 1 as this is the quantity)
- Cell value for E9 of the worksheet entitled "Cost Calculator" needs to = the cell value for A3 of the worksheet entitled "Costs"
- Cell value for E10 of the worksheet entitled "Cost Calculator" needs to = the cell value for B3 of the worksheet entitled "Costs"
- Cell value for E11 of the worksheet entitled "Cost Calculator" needs to = the cell value for C3 of the worksheet entitled "Costs"
- Cell value for E12 of the worksheet entitled "Cost Calculator" needs to = the cell value for D3 of the worksheet entitled "Costs"
- Cell value for E13 of the worksheet entitled "Cost calculator" needs to = the cell value for E3 of the worksheet entitled "Costs"
- Then the calculated result in cell E22 of the worksheet entitled "Cost Calculator" needs to be copied and the value pasted into G3 of the worksheet entitled "Costs".
Then the same offset as before 21 times and loop.
I'm not even sure if this is possible with Excel, but I figure if it is someone out here will be able to assist. Please let me know if you have any questions for what I am asking, I tried to be as descriptive as possible. Hopefully the idea is conveyed and if I need to reformat the layout of my sheets to accommodate the code that can be done as well.