Count Pledges  Problem

Input integer pledges (1, 2, 3, 4, or 5), these are the possible dollar amounts for donors. To stop the program enter a 0 amount. Total the pledges. Cross-check the total by using a count array to count the number of each type of donation (number of people who gave $1, $2, etc.) Multiply  these count by the associated dollar amounts and add them together to check the above total. Display the count value of each group and the final total if the cross-check matches. Use a Do-Loop to enter the pledges and a For-Next loop  in the code to display the counts. When testing the program put in 1 pledge of $1, 2 pledges of $2, 3 pledges of $3, 4 pledges of $4, and 5 pledges of $5. The total pledge amount should be $55.

Create a flowchart and VBA code to solve this problem. Create a command button on the spreadsheet named cmdCountPledges. Place the code under the Click event of a command button titled “Count Pledge Type”.

Flowchart Solution

Sample Screen Shots

VBA Solution Code