Consulting

Results 1 to 2 of 2

Thread: Compare Private Function help.

  1. #1
    VBAX Newbie
    Joined
    Sep 2008
    Posts
    3
    Location

    Compare Private Function help.

    I need to create a private function called compare that does the following:

    1.Create a private function called Compare that has two arguments: The random number and the average. The function will return an integer. The function will test three conditions:
    1. Number is greater than average, return a 1
    2. Number is equal to average, return a 2
    3. Number is less than the average, return a 3
    2.Since each number must be passed to Compare, a While/Wend loop should be constructed first
    3.With in the body of the loop, an If/Then/ElseIf statement will be required to invoke the function; pass random number and pass average; determine if a 1, 2, or 3 was returned from Compare function.
    4.If the result is a 1, a label stating the number is greater than the average should be written to the sheet. If the result is 2, a label stating the number is equal to the average should be written to the sheet. If the result is 3, a label stating the number is less than the average should be written to the sheet

  2. #2
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    Please stick to one thread with your question. Posting multiple posts with the same question will not help you get help any faster, in fact it makes things confusing and if people catch you at it they will stop helping you at all.

    I also notice that you fail to declare that this is classwork in this post. We have strict rules about classwork. Doesn't mean folks won't help you but will not give you a full solution. You will have to do your own work and ask specific questions.

    Thanks for understanding......I am locking this thread. Continue your discussion and questions in your original thread.
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

Posting Permissions

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