PDA

View Full Version : Solved: Quick question for anyone with VB



TheAntiGates
08-08-2007, 12:33 PM
I know what this does in VBA. Could someone tell me how many lines it prints in regular Visual Basic? Thanks.Sub JimmyLoopVar()
Dim i As Long, K As Long
K = 6
For i = 0 To K
If (i > 3) Then K = 2
Debug.Print i; ; K
Next
End Sub

Bob Phillips
08-08-2007, 01:23 PM
Here's the output

0 6
1 6
2 6
3 6
4 2
5 2
6 2

TheAntiGates
08-08-2007, 01:53 PM
Gracias.