Automatization routine
Eirik,
The easiset way would be to create a custom worksheet function, so you just
enter, in the required cell, say E2:
=PriceModel(A2,B2,C2)
and the answer is returned. Copy down, to calculate all 200.
In the VBA editor, add a Module. Add this code:
Public Function PriceModel (arg1 as Double, arg2 as Double, arg3 as Double)
as Double
PriceModel =arg1*arg2/arg3
End function
OK, the return value's and arguments' data type and inner code depends on
how you price model works, but that is up to you.
NickHK
"Eirik Sævareid" wrote in message
...
Dear all,
I am doing a study of product costs versus revenues for a set of products
at
a company. It is a developed a "price model" which returns a product cost
based on input in three cells. I am going to carry out a study for about
200 products.
Then I wonder if it is possible to develop a macro or something that can
do
this in a simple way (for me to avoid punching all the values). The input
data is stored in an excel sheet (one row for each product). The product
codes (which are input data in the price model) for a given product may be
stored in cells A2, B2, and C2 (for example) in a sheet called "data".
These data should then be entered into three cells in sheet "pricemodel"
(for instance B2, C2, D2), and a result comes in cell E2 in sheet
"pricemodel". This result should then be transferred to cell D2 in sheet
"data". Then the routine should continue with the next product (cell A3,
B3, C3 in sheet "data") until this has been done for all 200 products.
Is there any way to automatize this task (macro or another way) ?
Please revert if my explanation is insufficient.
All help will be greatly appreciated.
Best regards,
Eirik Saevareid
|