Excel do while statement

Associate
Joined
18 Oct 2002
Posts
710
Location
Somerset
I have put together a macro to run on the press of a button, all is working until close to the end,
I have a do while loop set out like this

Do While condition
statements
loop

which is the method i found via google,
there are no () around the condition and no () or {} around the long list of statements as nothing has said they are needed or excel throws an error if i try to put any in to tie things together.

When i try to compile it i get a 'loop without do' error and have no idea why.

Can anyone help?

Thanks
 
Have you tried VBA own help?
just cursor to 'do' in your macro and press F1

Without seeing the code, it will be difficult for anyone to help.
 
Try going through your VBA code in 'Step Through' mode (press F8 in the VBA editor) and this should pinpoint exactly where it is failing.

If you want to post the code, I'm happy to take a look.
 
Back
Top Bottom