Excel VBA While Loop – Inner Loops Explained

Publicado el: 20 julio 2018
en el canal de: Alex Luy
1,786
39

In this advanced Excel VBA lesson, we take While loops to the next level by introducing nested (inner) loops.

Instead of looping down a single column, you'll learn how to:

Loop across columns within a row

Then move to the next row and repeat

Debug While loops with control variables

Avoid common mistakes like forgetting to reset counters

We walk through printing values row-by-row and column-by-column, and show you how to fix logic errors that stop loops from progressing.

🔁 Looping Topics Covered:

Outer vs Inner loops

Row and column control variables

Avoiding infinite loops and logic bugs

Real use case with random Excel values

✅ Bonus Exercise: Try copying the values to another location in your sheet using the loop structure!

00:00 – Intro: Welcome back, let’s go deeper with loops
00:14 – Recap: Last time we looped through rows only
00:26 – Goal: Print values row-by-row, column-by-column
01:00 – Explaining row and column limits (Row 12, Column 4)
01:40 – Declaring maxRow and maxCol variables
02:20 – Why we use less-than condition in While loops
03:10 – Setting up starting points for row and column
04:00 – Building the outer While loop (row-based)
05:00 – Introducing the inner While loop (column-based)
06:00 – Printing each cell’s value using `Cells(row, column)`
07:00 – Common mistake: Forgetting to increment counters
08:00 – Tracing the loop logic with debug prints
09:00 – Logic bug: Why only Row 1 prints
10:00 – Dora moment: Can you find the error?
11:15 – Fixing the bug: Re-initialize column to 1
12:00 – Final result: Full table printed row by row
12:50 – Practice challenge: Copy data instead of printing
13:30 – Where to go next – insert values into cells
14:00 – Wrap-up: Free content, no ads


En esta página del sitio puede ver el video en línea Excel VBA While Loop – Inner Loops Explained de Duración hora minuto segunda en buena calidad , que subió el usuario Alex Luy 20 julio 2018, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 1,786 veces y le gustó 39 a los espectadores. Disfruta viendo!