Re: code loops 1024 times not what i ask

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Hi Rob,

Your code works for me.

To test it, I changed:

x = x + 1

to

x = x + 1
Debug.Print x

What final value do you get in the intermediate window if you add the debug
line?

---
Regards,
Norman



"Rob Hargreaves" <nrgsav@xxxxxxxxxxxxxxxxxxxxx> wrote in message
news:42f5dc50_4@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> Hi
>
> I wonder if someone can help, I am trying to repeat some code 200 times
> can you tell me where I am going wrong in my loop.
>
> (It is doing 1024 times!)
>
> Sub test()
> Dim x As Integer
>
> Do Until x = 200
> 'code to repeat
> x = x + 1
> Loop
>
> End Sub
>
> thanks for your help.
>
> Rob
>
>


.



Relevant Pages

  • Re: code loops 1024 times not what i ask
    ... > I wonder if someone can help, I am trying to repeat some code 200 times can you tell me where I am going wrong in my loop. ... > Sub test() ... > Dim x As Integer ...
    (microsoft.public.excel.programming)
  • code loops 1024 times not what i ask
    ... I wonder if someone can help, I am trying to repeat some code 200 times can ... you tell me where I am going wrong in my loop. ... Sub test() ... Prev by Date: ...
    (microsoft.public.excel.programming)
  • Re: code loops 1024 times not what i ask
    ... Rob ... > I wonder if someone can help, I am trying to repeat some code 200 times ... > can you tell me where I am going wrong in my loop. ... > Sub test() ...
    (microsoft.public.excel.programming)
  • Re: acceptance of forth
    ... before entering an infinite loop (i.e. ... repeat jumps to after while instead of after begin?) ... begin..while..repeat has multiple templates (which, ... circumstances where I consulted the books. ...
    (comp.lang.forth)
  • Re: A Class of Non-Halting TMs
    ... >> Step, current state, input, and tape position. ... and so it will loop forever" may not be true. ... if you take a nonhalting machine history which eventually ... My method will say steps 7-8 repeat: ...
    (comp.theory)