Sub CleanUpCommentColumn()
'
' Clean Up the Comment Column Macro
' AUTHORIZED WORD LIST
' LA
' CONSULT
' INSPECT
' TEST
' PHYS
' ENLIST
' DEP IN
' TAPAS
' INTERVIEW
' SEC INT
Application.ScreenUpdating = False ' turn OFF the screen updating
'---dim the variables
Dim NewWords As String
Dim c As Range
For Each c In Range("L1:L200")
If InStr(c.Value, "LATE") > 0 Then
NewWords = "LA "
End If
If InStr(c.Value, "*PS*") > 0 Then
NewWords = NewWords & "PS "
End If
If InStr(c.Value, "PRIOR SERVICE") > 0 Then
NewWords = NewWords & "PS "
End If
If InStr(c.Value, "CONSULT") > 0 Then
NewWords = NewWords & "CONSULT "
End If
If InStr(c.Value, "TAPAS") > 0 Then
NewWords = NewWords & "TAPAS "
End If
If InStr(c.Value, "INSPECT") > 0 Then
NewWords = NewWords & "INSPECT "
End If
If InStr(c.Value, "ASVAB") > 0 Then
NewWords = NewWords & "TEST "
End If
If InStr(c.Value, "TEST") > 0 Then
NewWords = NewWords & "TEST "
End If
If InStr(c.Value, "PHYS") > 0 Then
NewWords = NewWords & "PHYS "
End If
If InStr(c.Value, "ENLIST") > 0 Then
NewWords = NewWords & "ENLIST "
End If
If InStr(c.Value, "DEP") > 0 Then
NewWords = NewWords & "DEP-IN "
End If
If InStr(c.Value, "INTERVIEW") > 0 Then
NewWords = NewWords & "SEC-INT "
End If
NewWords = Trim(NewWords)
Dim iSpace As Integer
iSpace = InStrRev(NewWords, Space(1))
If iSpace > 0 Then NewWords = Left(NewWords, iSpace) & "&" & Mid(NewWords, iSpace)
c.Value = NewWords
NewWords = ""
Next c
Columns("L:L").EntireColumn.AutoFit
Application.ScreenUpdating = True ' turn ON the screen updating
End Sub