Peter Chan
asked on
Problem to line
Hi,
I get syntax error to this line
I get syntax error to this line
If (Trim(ConfigWS.Cells(i, "D").Value) = "") Then Continue For
within one For loop. why?
Looks good but
1/ Is the value "i" declared and an integer or long type
2/ Has ConfigWS been created as a worksheet object
What exact error are you getting?
A single line of code often does not give us the information to correctly analyse the issue and so posting the workbook or at least posting the entire function will help us in resolving the issue
1/ Is the value "i" declared and an integer or long type
2/ Has ConfigWS been created as a worksheet object
What exact error are you getting?
A single line of code often does not give us the information to correctly analyse the issue and so posting the workbook or at least posting the entire function will help us in resolving the issue
ASKER
I want to skip the loop, within If. What to adjust?
Yeah, "Continue For" isn't proper syntax.
Instead of looking to continue, look for something to not continue and perform your action....
Instead of looking to continue, look for something to not continue and perform your action....
For i = 1 To 100
If Trim(ConfigWS.Cells(i, "D").Value) <> "" Then
'Do your thing
End If
End if
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Continue For is part of Visual Studio 2015.
If this is VBA, then you will need to do what I describe in this Next Iteration article:
http://rdsrc.us/VCFFaB
// is not a valid comment indicator in VBA
http://rdsrc.us/VCFFaB
// is not a valid comment indicator in VBA
>>// is not a valid comment indicator in VBA
exactly Aikimark... thks for highlighting, was posted too quickly and still thinking to code in C# environment...
we should use ' instead for commenting in VBA.
exactly Aikimark... thks for highlighting, was posted too quickly and still thinking to code in C# environment...
we should use ' instead for commenting in VBA.
exit is not the same as continue. Do you want to stop the loop (and continue with execution after the loop) or skip this loop iteration (and continue with the next loop value)?
Open in new window
orOpen in new window