Let me post a few general comments about this code. Let's start with some comparison statements. I'd never compare Booleans to their actual values. Instead of:
Code:
If expr = True Then ...
I would just use:
and vice versa, instead of:
Code:
If expr = False Then ...
use:
Code:
If Not expr Then ...
It's shorter and a bit less error prone (some methods might return values other than True [-1] or False [0] as a Boolean value and comparing it to True will not work, however using just "If expr Then" will succeed for any non-zero value of "expr").