Consulting

Results 1 to 5 of 5

Thread: VBA Code

  1. #1

    Exclamation VBA Code

    I have been assigned a VBA homework assignment, which I have no idea how to write. I barely know basic SQL, and this assignment is due tomorrow morning. In exchange for assistance/solving the problems, I will provide monetary compensation to whoever helps me. The assignment is listed below:

    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
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    I am confused, is this an SQL query against a database, or a VBA query against a spreadsheet?
    ____________________________________________
    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
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    I think he got an "F" last January
    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

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Blimey Sam, you are right. He posts the same 'urgent' problem every month. Shall we just throw him into the bin
    ____________________________________________
    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

  5. #5
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    Nah, He ain't no problem.
    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

Posting Permissions

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