The For loop is another simple loop structure, which is different from other loops like Do loop and While Loop because it specifies a range before the loop could start.
The syntax for the For loop is given below.
For index = start To end [Step step] [Statements] Exit For [Statements] Next index
Let us discuss the For loop structure.
For – keyword indicating the type of loop structure.
index – a variable that acts as index for the loop.
start To end – values that indicates
start of the loop and
end of the loop
Step step – The integer value that indicate how much to increment the loop at each iteration. Default is 1.