Excel VBA For Loop Tutorial – Print Values with Nested Loops

Опубликовано: 29 Июль 2026
на канале: Alex Luy
1,657
28

In this Excel VBA tutorial, you'll learn how to use the For loop to iterate through rows and columns in a worksheet — a foundational skill for automating repetitive tasks in Excel.

This video covers:

How For loops work in VBA

Declaring and using loop control variables

Printing values from cells using Cells(row, column)

Creating nested For loops to iterate over 2D ranges

Differences between While loops and For loops in VBA

A preview of how to copy a range using loops (covered in Part 2)

This lesson is 100% beginner-friendly and ad-free.

💻 Ideal for: Excel users, analysts, and professionals looking to automate their spreadsheets.

🔗 Want to go deeper?

✅ No ads. No fluff. Just real Excel VBA.

00:00 – Intro: Welcome and topic overview
00:10 – Recap of While Loops in previous videos
00:28 – Goal: Print values in Column A (Row 1 to Row 12)
00:45 – Accessing cells with Cells(row, column)
01:10 – Setting up the For loop: syntax and control variable
01:50 – Declaring counter: Dim i As Integer
02:15 – Loop structure: For i = 1 To 12 ... Next i
02:50 – How VBA auto-increments i with 'Next'
03:30 – Printing cell values with Debug.Print Cells(i, 1)
04:10 – Testing: Printing Column A values to console
04:40 – Transition: Printing all rows and columns
05:00 – Nested For Loops: Adding column loop with variable `c`
05:30 – Printing 2D range: Cells(i, c).Value
06:15 – Understanding how inner/outer loops work
07:00 – Why For loops don’t need manual resets like While loops
07:30 – Running full nested loop – all values printed
08:00 – Preview: Copying the full range to a new location
08:30 – Wrap-up: What’s coming in Part 2
08:50 – Outro: Subscribe and no ads ever!