Consulting

Results 1 to 3 of 3

Thread: VBA code Help

  1. #1
    VBAX Newbie
    Joined
    Dec 2013
    Posts
    2
    Location

    VBA code Help

    I am looking for some help with this assignment that I was given in class. I have not had much experience writing vba code so anything would be appreciated.

    Write the VBA code for the following situations:


    1. An array of Currency values is called Sales. It contains all of the sales in
    a given month. Write the code to calculate the total sales in that month
    and the average amount of a sale in that month. Declare all variables
    necessary.
    2. There are two arrays of the same size: Customers and Sales. The
    Customers array contains Long values, which are the Customer IDs. The
    Sales array contains Integer values, and contains the number of sales
    made by each of those Customers. Sort the Sales array in order of highest
    number of sales to lowest number of sales. Make sure to keep the
    Customers array values in the same order, so that the index of a Customer
    ID would be the same index used in the Sales array to find their total
    sales.

    NOTE: You can use whatever sorting algorithm you wish. If you don’t
    know any, you might need to find one online. You can use a separate
    array to move the sorted items into temporarily, but then you must copy
    the values, in order, back into the Sales and Customers arrays.

  2. #2
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

  3. #3
    I assume you are wanting to learn how to do this and not expecting anyone to do you homework.

    For us to help you learn you shoudl ask specific questions about what you have attempted.

    Please post the code you have written so far so we can see what you tried.
    Boyd Trimmell aka HiTechCoach
    Microsoft Access MVP -2010-2015

    Programming: Nine different ways to do it right, a thousand ways to do it wrong.
    Binary--it's as easy as 1-10-11

Tags for this Thread

Posting Permissions

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