Pricing Program and If-Then Statements

S

Sherch

Hello Everyone,

I am new at this macro thing so bear with me. I am designing a pricin
program for work. We need to be able to price rectangular roof curb
and right now we use a hard copy matrix with numbers based on size.
There are all sorts of additional options you can add to the curbs
mostly in the form of percentage adds based on size.

My questions involve making the program work for a list of curb sizes.
Right now I have a macro set up that will give you a final price base
on the size and different options, but it will only do it for one curb
I need to make a sheet that will allow me to select all the options
and then send the selected options, as well as the length, width an
model number to the macro I already have for pricing. Not sure i
anyone can point me in the right direction. I am thinking of using I
- Then statements to go through the list and send model numbers an
sizes to the macro, but im afraid that it will still only work for on
curb. Any help you have is greatly apreciated. Thanks in advance!

Stev
 
K

Ken Wright

You should be able to set up some input cells for your variables, use Data
Validation on them to give you a dropdown list of valid items to choose from,
and then use VLOOKUP or INDEX/MATCH to match the data up with the data in the
tables. This would all be live and interactive with likely no need for VBA at
all. If you have any more specific detail then post back and we'll do what we
can to help.
 
B

BrianB

Not 100% clear about what you want. Perhaps a loop to go through a lis
in a worksheet. eg.

'-------------------------------------------------
Sub TEST()
For myrow = 1 To 100
MyWidth = ActiveSheet.Cells(myrow, 1).Value
MyLength = ActiveSheet.Cells(myrow, 2).Value
MyModel = ActiveSheet.Cells(myrow, 3).Value
MyPrice = ActiveSheet.Cells(myrow, 4).Value
'- call existing routine called 'Sub DoCalculation()'
'- which sets a variable called 'MyResult'
'- based on variables above
DoCalculation
'- record result
ActiveSheet.Cells(myrow, 5).Value = MyResult
Next
End Sub
'-----------------------------------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top