Twitter
LinkedIn
YouTube
RSS
Facebook

VBA Do Loop

Looping structures like the VBA Do Loop allow you to specify the conditions under which you would like your program to run a set of code statements repeatedly.

There are 4 different variations of the VBA Do Loop we are going to look at:

‘Do While…Loop structures check the condition before running the code.
‘The code in the loop is run only if the condition evalutes as True, and
‘repeats until the test expression evaluates as False…Example…

1

‘Do Until…Loop structures check the condition before running the code.
‘The code in the loop is run only if the condition evaluates as False,
‘and repeats until the test expression evaluates as True…Example…

1

‘Do…Loop While structures check the condition after running the code and
‘repeat a code block until the test expression evaluates as False…Example…
1
‘Do…Loop Until structures check the condition after running the code and
‘repeat a code block until the test expression evaluates as True.

1

Watch the video:

Exit a VBA Do Loop by using the Exit Do statement.

<< VBA Error Handling PT2 | VBA For Loop >>


Sign Up For A FREE MS Access VBA Video Tutorial Subscription. You will get over 27 tutorial videos that will help you do your job better! Start Yours Now At:
http://vbahowto.com/ms-access-tutorial

Helpful? Consider giving us a tip. Thanks!

($5 suggested amount)
(...10% of your gift amount will go to charity)




Want All The Access Videos?, Click Here!





Need help? Click and Call LoeblCom Services



Leave a Reply

You must be logged in to post a comment.