Maintainting the reference of a cell in another workbook

I’ve looked into the naming range option in Ms Excel which I’ve applied on my data as presented above in the post.Problem is my template is based on smart markers containing multiple groups and if I name subtotal field and use that name in the formula. It picks up the value for the last group only.

How can I restrict it to pick up the desired group subtotal.
i am attaching two excel workbooks. Test serves as my template report containing datamarkers and Test Smart Marker contains the driven from Test. Please take a look at these. perhaps they might come handy.
Please provide me a small example.
I would appreciate this a lot.
Thanks

Hi,


Well, I am afraid if there are multiple groups of data to be sorted out, then assigning named cells/ranges in the template file might not work as you may understand it. If you have only one group of data, then assigning named cells and add reference to other worksheets in the template file might work for you.

Also, we have investigated it a bit and we cannot support it as we cannot just build proper logic for it.
I can see one option though, you have to do it by yourself using your codes, you will not assign named cells in the template file and also you will not add references for those cells in the other worksheets in the template file. The only thing you may do is you will do it after processing the markers in the cells and then finding the cells having e.g “=Subtotal()” formula string (you may use Cells.FindFormula, FindFormulaContains or Find methods etc. — See the topic: http://www.aspose.com/docs/display/cellsnet/Find+or+Search+Data) to first find your desired formula cells and then add reference to those cells in other worksheets dynamically if it fits his needs. Note, in that case, adding reference to other worksheets would be dynamic and you cannot specify the references for the cells/ranges in the template file.

Thanks for your understanding!