VBA For Loop
A For loop is a repetition control structure allows a developer to be logical write a loop which needs to be executed a specific number of times.
Here is some flow of control in for loop as given below, such as:
The For loop executes a block of code a specific number of times.
Nested For Next loops
You also can use the nested for loop to get the more complex automation done in excel. There would be a "For Next" loop within a "For Next" loop.
For example: Suppose you want to protect all the worksheets in all open workbooks in your system.
Exit For statement
You can exit the for loop statement without completing the full cycle by using the exit for the statement. The Exit for command will immediately stop the execution of the existing loop.
For example, It is a more efficient way to check if there are any negative values or not. But in this case, there are no negative values, and we can exit the loop and save some VBA processing time.