These simulate what you want. However, for better practice, if possible you should try to avoid using GoTo. Use the way westconn1 mentioned above.
Code:Sub XXX() Dim x As Long For x = 1 To 10 If x Mod 2 = 0 Then GoTo Next_x '-- use Goto Label '... ... Debug.Print x & " is an odd number." Next_x: Next End Sub Sub XYZ() Dim x As Long For x = 1 To 10 If x Mod 2 = 0 Then GoTo 99 '-- use Goto Line number '... ... Debug.Print x & " is an odd number." 99 Next End Sub




Reply With Quote