Loop – Excel Formula

3
Loops
Loops in vba

Loop

Here we are going to know about the loops in VBA. loops are 4 types in VBA. Those are while loop, loop, for loop, do while loop.

Loop is concept in programming language to run continuously until it gets particular given target. For example if you need to run the 100 numbers in vba program. You must use the loop concept to do this task. Then you need not write 100 lines of the code to print 100 numbers. This is a main advantage of the loop.

While Loop:

while loop is an excellent technique in programming and here you will know how to use in vba programming.

value to be initialized at first for while loop. Please find below the syntax for while loop

Dim i as integer

i=1                  <——– value initialization

while i<10        <——– Conditional statement

i=i+1               <——– value increment or decremented based on requirement

wend               <——— ending while syntax in vba

 

Loop:

 

 

3 COMMENTS

LEAVE A REPLY

Please enter your comment!
Please enter your name here