Under the LostFocus event for txtDown, enter the following. This procedure should also set the focus on the first text box. False Last but not least, we have to write the procedure for printing the form. The complete code for the program will be found in Appendix 2. Using Excel in conjunction with Visual Basic allows us to save lengthy coding and allows us to employ all of Excel's functions.
Lookup tables are just one of the powerful tools that can be directly accessed through Excel.
The following is the coding used to determine a final letter grade using the Select Case statement. The code above declares an integer type variable to store the final mark. The letter grade is stored in a string variable. Storing your final mark as an integer will round a decimal value to the nearest integer and saves writing your code to deal with rounding. It then starts with the highest possible value in your range, assigning an appropriate value to the string variable, and then works down the range.