Consulting

Results 1 to 5 of 5

Thread: Do loop search

  1. #1

    Do loop search

    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.

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    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.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Master paulked's Avatar
    Joined
    Apr 2006
    Posts
    1,007
    Location
    Have you written any of the code yet?
    Semper in excretia sumus; solum profundum variat.

  4. #4
    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

  5. #5
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    There is a site called RentACoder specifically for that.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •