Use Select Case instead of If-ElseIf
When performing multiple comparisons it is easy to get trapped into using multiple If-ElseIf statements. While that will certainly accomplish the task a cleaner, and more efficient, way to do this is to use the Select Case construct. Examples of the same comparison are shown below. In the Select Case example notice that you are not limited to comparing a single variable.
Tags: variables, VBA