' Declarations ordered alphabetically by type, and then by name Attribute VB_Name = "PrimeNumber" Const SEPARATOR = ", " Dim i As Integer ' As clauses lined up perfectly Dim j As Integer Dim prime As Boolean Dim PrimeList As String Sub Main() ' Blank line before every control ' structure (For...Next, If...End, etc.) For i = 1 To 99 ' Autoindent ensures that all code within a control structure ' lines up perfectly. prime = True For j = i - 1 To 2 Step -1 If i Mod j = 0 Then prime = False End If Next If Not prime Then MsgBox i & " is not a prime number" Else If i = 1 Then PrimeList = PrimeList & i Else PrimeList = PrimeList & SEPARATOR & i End If End If Next ' Spell-check found and changed several words in the message ' boxes, as you can see. MsgBox "Prime numbers calculated for 1 to 99", vbExclamation MsgBox PrimeList ' When the length of a line is greater than a number specified by ' the user, Polisher will insert a line continuation automatically. MsgBox "The Prime Number Generator is brought to you by The Number Guys." & _ vbCrLf & _ "Any comments or questions should be directed to our Maintenance Department." _ & vbCrLf & _ "If you know of any prime numbers we omitted, please contact us immediately." _ & vbCrLf & "Personal calculators are available from Sales." End Sub