In the 39th session of Chandoo.org podcast, Let’s learn about FOR loops.
There is a special giveaway in this podcast. It is a workbook with several FOR loop VBA code examples. Listen to the episode for instructions.

What is in this session?
In this podcast,
- Announcements
- What is a loop – plain English & technical definitions
- For Loop vs. other kind of loops (While & Until)
- For Next loops
- For Each loops
- Nested For loops
- Special tips on For loops
- Performance issues & infinite loops
- Conclusions & giveaway
Listen to this session
Podcast: Play in new window | Download
Subscribe: Apple Podcasts | Spotify | RSS
Click here to download the MP3 file.
Links & Resources mentioned in this podcast
Introduction to VBA
- Introduction to Excel VBA – 5 part crash course
- Introduction to VBA – what is it and how to get started – Podcast #22
Using FOR Loops – Examples
- Looking up when data wont play nice – Using FOR Loops
- Understanding variables, conditions & loops in VBA
- Split an Excel file in to many using For Each loop
Optimization & Performance of VBA code
Transcript of this session:
Download this podcast transcript [PDF]
Are FOR loops strong with your VBA code?
I personally favor FOR loops over While loops. I learned about loops in 1996 (in BASIC language). Any powerful application or program I have built ever since has its share of FOR loops. They are vital for doing awesome things with computers.
What about you? Do you use FOR loops often? When do you use them? What are your favorite implementations. Please share your tips & thoughts in the comments area.
Remember: Email me at chandoo.d@gmail.com once you finish the task mentioned in the podcast to get your FOR loops example workbook.

















8 Responses to “Introducing PHD Sparkline Maker – Dead Simple way to Create Excel Sparklines”
This looks like it could be very useful for a project I'm putting together right now, thank you so much. Quick & silly question, how do I copy & paste the sparkline as a picture?
Question answered. For anyone else:
Select chart>Hold Shift key & select Edit/Copy Picture>Paste
[...] more information about PHD Sparkline Maker, please read this article and to learn more about Sparklines, read this article from Microsoft Excel 2010 blog. Also there [...]
Am I right in thinking that the y-axis is set automatically by excel?
That makes it possible to get the column chart not to start at zero.
Andy - yes, it is currently set to 'auto', which defaults to a zero base for positive values, but you can change that by left-clicking the chart, then choosing (in Excel 2007):
"Chart Tools/Layout/Axes/Primary Vertical Axis/More Primary Vertical Axis Options"
PUBLIC SERVICE ANNOUNCEMENT: When manually editing a chart's minimum/maximum axis values, PLEASE be sure there's a valid reason and that doing so won't skew the message shown by the data (e.g. by exaggerating differences). If in doubt, go back and read Tufte. (W.W.T.D.?)
[...] gridlines, axis, legend, titles, labels etc.) and resize it so that it fits nicely in a cell [example]. This is the easiest and cleanest way to get sparklines in earlier versions of excel. However this [...]
thanks for the work creating the template!!!!
looks good