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
Nesta página do site você pode assistir ao vídeo on-line Excel VBA While Loop – Inner Loops Explained duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário Alex Luy 20 Julho 2018, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 1,786 vezes e gostou 39 espectadores. Boa visualização!