Question Details

(solution) I am working in VBA assignment and need to make an array that


I am working in VBA assignment and need to make an array that auto populates the values 16 to 9 in reverse order. this is my current code:


 nTeams = 16                     ' variable to enable other size brackets

    

    ReDim arrBracket(nTeams / 2) '<< ReDim array to appropriate size

    

    

    '***** Fill the array where element 1 of the array holds the value of the

    '      lowest seed (e.g. if 16 teams, element 1 has a value of 16)

    

    ' vvv your For/Next loop below

    Dim nTeams2 As Integer ' Place holder for For/Next loop

    

    For i = 1 To (nTeams / 2)

        For nTeams2 = nTeams To (nTeams / 2) Step -1

            arrBracket(i) = nTeams2

        Next nTeams2

    Next i

    


The issue is that it now is only filling the array with the number 8 for each of the 8 elements, rather than 16, 15, 14, 13, etc.


Here is the loop my professor included to check the work:


For i = LBound(arrBracket()) To UBound(arrBracket())    ' loops through the array

        Debug.Print i & " vs " & arrBracket(i)              ' sends array info to immediate window

    Next i

 


Solution details:

Pay using PayPal (No PayPal account Required) or your credit card . All your purchases are securely protected by .
SiteLock

About this Question

STATUS

Answered

QUALITY

Approved

DATE ANSWERED

Sep 13, 2020

EXPERT

Tutor

ANSWER RATING

GET INSTANT HELP/h4>

We have top-notch tutors who can do your essay/homework for you at a reasonable cost and then you can simply use that essay as a template to build your own arguments.

You can also use these solutions:

  • As a reference for in-depth understanding of the subject.
  • As a source of ideas / reasoning for your own research (if properly referenced)
  • For editing and paraphrasing (check your institution's definition of plagiarism and recommended paraphrase).
This we believe is a better way of understanding a problem and makes use of the efficiency of time of the student.

NEW ASSIGNMENT HELP?

Order New Solution. Quick Turnaround

Click on the button below in order to Order for a New, Original and High-Quality Essay Solutions. New orders are original solutions and precise to your writing instruction requirements. Place a New Order using the button below.

WE GUARANTEE, THAT YOUR PAPER WILL BE WRITTEN FROM SCRATCH AND WITHIN A DEADLINE.

Order Now