PDA

View Full Version : Do loop search



rollwave7187
12-05-2007, 04:41 PM
I'm new to VBA but am currently running a business and could really use some help in creating a macro to make my discount process easier for my customers. If someone could help me write code for the following code it would be greatly appreciated..

a. Write a sub-routine that asks for a product code using an input box. This should be placed inside a Do loop that checks whether the code is one on the list. The code starts in cell a4 and ends at a124. It should then ask for the number of units purchased, which must be a positive number. (You may select an integer as the data type ? however, it is safe to assume that the user will not enter a number like 3.84.) It should display a message something like the following: ?You purchased at least ________________ units, you got a discount of _________________ on each unit.? Of course your code will fill in the blanks. The last sentence will not be displayed if the user didn?t purchase enough units to get a discount.
b. Now write a sub-routine that first asks the user for the number of different products purchased. Then use a For loop that goes from 1 to this number, and place the code from the previous exercise modified if necessary inside the loop. That is, each time through the loop you should get the display information about a particular product purchased. At the end of the sub, display a message that shows the total amount spent on all purchases.
c. Finally, write a sub-routine that asks the user for a purchase quantity that can be any multiple of 5 units, up to 50 units. Then enter a label in cell E3 entitled Cost of _______ units?, where the blank is filled in by the user?s input. Below this, enter the total cost of this many units for each product. For example, cell E4 will contain the purchase cost of this many units (the amount the user enters) of the first product in the list. Enter these as values, not formulas.

Bob Phillips
12-05-2007, 05:27 PM
Peresonally, I think this is over-stepping the bounds of help, you want us to write a mini-app for you to support your business. I for one am not into that.

paulked
12-05-2007, 05:27 PM
Have you written any of the code yet?

rollwave7187
12-05-2007, 05:31 PM
no i haven't, i dont even know where to start, ive only been coding for a few weeks, ill be willing to pay 20 bucks through paypal to anyone who can write it for me providing it works, i could really use some help

Bob Phillips
12-06-2007, 01:59 AM
There is a site called RentACoder specifically for that.