In Test1 (i.e., For a = 1 To 3 Step 1 ), after the third time through the loop, a increases by 4. Since this is more than 3, it stops and displays 4.
In Test2 (i.e., For a = 1 To 3 Step -1 ), a initially set to 1. Since it is already less than 3, it immediately stops and displays 1.
In For a = 1 To 1 Step 1 , a set to 1, which is not more than 1, so the cycle continues, and then a increases by 2. When 2 is greater than 1, it stops and displays 2.
In For a = 1 To 1 Step -1 , a set to 1, which is not less than 1, so the loop continues, and then a decreases to 0. Since the value 0 is less than 1, it stops and displays 0.
In For a = 1 To 2 Step 1 , a set to 1, which is not more than 2, so the cycle continues, and then a increases by 2, and then a increases by 3. Since 3 is greater than 1, it stops and displays 3.
In For a = 1 To 2 Step -1 , a set to 1, which is less than 2, so the loop stops and displays 1.
The actual process in these cycles:
All of this is documented on the MSDN re "For ... Next Statement" page.