I have a table called UpdatedFigures with the following headings: ProductType, Month13, Month14, Month15.......Month24. Under each month there are numeric values and under Product type there is a row for ProductAlpha, ProductBeta and ProductGama. Each Row is populated with eh numeric values from the months.

I have a separate table called ModelObject with a single column called Script.

In the script column I have
with_cell_ProductAlpha_TimePeriod.###.SetValue$$$
with_cell_ProductBeta_TimePeriod.###.SetValue$$$
with_cell_ProductGama_TimePeriod.###.SetValue$$$

I need to do a while loop that will will replace the ### with Month13 through to Month 24 and replace the $$$ with the corresponding values for the Months.

The scripts for ProductAlpha, ProductBeta and ProductGama will have 12 iterations each.

This is the basic concept I will need to apply it on a much larger scale.

FYI I need a loop because what I want eventually is

with_cell_ProductAlpha_TimePeriod.Month13.SetValue 2525
with_cell_ProductAlpha_TimePeriod.Month14.SetValue 473643
with_cell_ProductAlpha_TimePeriod.Month15.SetValue $$$
"
"
"
with_cell_ProductAlpha_TimePeriod.Month24.SetValue 7347338

with_cell_ProductBeta_TimePeriod.Month13.SetValue$$$
with_cell_ProductBeta_TimePeriod.Month14.SetValue$$$
with_cell_ProductBeta_TimePeriod.Month15.SetValue$$$
"
"
"
with_cell_ProductBeta_TimePeriod.Month24.SetValue$$$

The $$$ will change to numeric values from the Updated figures table which looks like this:

Product Type Month13 / Month14/...Month17/..............Month24
ProductAlpha 2525 / 473643 /...some value/............7347338
ProductBeta 4534 / 623632 /...some value/...........38628638
ProductGama 6583 /834773 /...some value/...........84723236

This is a very simplified model. My actual Updated figures table contains over 2000 Product Types.

Thanx in advance!!!

What have you tried so far?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.