Avatar of Peter Chan
Peter Chan
Flag for Hong Kong asked on

Problem to skip loop

Hi,
I want to skip the loop below, per relevant conditions are matched
    Do While True
        ...

            If Trim(Worksheets(List0).Cells(RowID, 8).Value) <> "" And InStr(User_List, ";" & Trim(Worksheets(List0).Cells(RowID, 8).Value)) = 0 Then Continue Do
            End If

Open in new window

but I get 'Syntax Error' due to 'Continue Do'. What to adjust?
Microsoft ExcelMicrosoft OfficeVisual Basic ClassicVBAVB Script

Avatar of undefined
Last Comment
Saqib Husain

8/22/2022 - Mon
Saqib Husain

Exit do is used to skip loop

do while condition
     if certain condition then
             exit do
     endif
loop
GrahamSkan

If you want to leave the Do loop then use Exit Do
Peter Chan

ASKER
No, I only want to skip one iteration, and not to leave the whole loop.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
SOLUTION
Rob Henson

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
ASKER CERTIFIED SOLUTION
Saqib Husain

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Saqib Husain

Looks like you are not fully satisfied with the answer.