Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
what loop structure???
just a quick question what loop structure would be most appropriate to
use if im checking for a condition at the end of the loop? i dotn no many other loops if anyone no,s ou there can they show me an example so i can see how its done thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
what loop structure???
Loops generally have 2 approaches. The following is from the VBA Help entry
on Do..Loop: Do [{While | Until} condition] [statements] [Exit Do] [statements] Loop Or, you can use this syntax: Do [statements] [Exit Do] [statements] Loop [{While | Until} condition] The primary difference between the 2 is that statements within the 1st method will only be executed if the condition statement is initially True. In the 2nd method, statements within the loop will always be executed at least ONCE. After that, the condition has to be true for the loop to repeat. So, its not really a question of what's best to test for a condition at the end of the loop, either method will effectively do that. It's really a question of what do you want to happen when the loop is first encountered. HTH, "paul" wrote in message ups.com... just a quick question what loop structure would be most appropriate to use if im checking for a condition at the end of the loop? i dotn no many other loops if anyone no,s ou there can they show me an example so i can see how its done thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Formula structure | Excel Worksheet Functions | |||
array structure | Excel Programming | |||
Need loop structure to get round limited IF statements | Excel Discussion (Misc queries) | |||
if structure help | Excel Programming | |||
Structure of If...Else in VBA | Excel Programming |