String data cannot be added directly to numeric variables . Otherwise the script sets out to edit for a valid number and handle any eventuality the programmer has envisioned. The following statements cause an immediate Exit Sub if the action was a mouse click on cmdExit, otherwise the next edit in sequence is applied to txtNumGrades. Then Exit Sub 'there needs to be a something in this box before anything else can happen If txtNumGrades. A ruler placed along the left edge of the script intersects with the beginning and end of each logic structure.
Geeks say 'the body text is indented' to highlight the structure of the algorithm.
These would be entered in VB on a single line.