Tricky. You should not DIM the vars you used a second time in a While/Loop or a If/EndIf.