For Loops, Cells & Iterators with VBA

mtgingrass

2017/09/22

Cells and for loops.

In this tutorial, we will take a lateral approach to ranges and instead, use cells.

This quick 5 minute video will walk you through why cells are easier to work with when iterating through loops; specifically, for loops. In addition, this video shows you the value of the debugger when testing programs at runtime. In this tutorial you will learn the basics of:

Watch the Video for step by step instructions.

[embed]https://youtu.be/pVIa7bDYHeg[/embed]

Code

Copy and paste the code below to get you started.

<code>
Option Explicit

Sub using_cells()
    Dim iterator as Integer
    iterator = 1

    For iterator = 1 to 13
         Cells(10, iterator).Value = ""
    Next

End Sub</code>
comments powered by Disqus