How To Create A Loop Within A Loop In Excel VBA (MM LITE #1)

How To Create A Loop Within A Loop In Excel VBA (MM LITE #1)


How can Excel VBA help you do a typical manual task at the click-of-a-button?  We're all tired of repetitive manual work in Excel!  

In this video, I show how you can use a loop within a loop in Excel VBA to transform a dataset in Excel.  This task might take hours manually; with the right VBA skills it takes less than a few seconds - after you've written the Excel VBA, code, of course!  It's a real-world task requested by a channel viewer.

CLICK HERE TO WATCH THE VIDEO

Use the timestamps below to help you navigate this Excel VBA tutorial.  Though it can be complicated to set up a 'loop within a loop', note that the usual Excel VBA techniques are used here: loops, variables, position control and a few others.  More important, however, are the Excel VBA 'metaskills' shown in the video: note how Chris plans the task first then tests and debugs the routine as it grows.

 
Timestamps

00:00 Excel VBA Tutorial Introduction
00:34 Description Of The VBA Task
00:41 Planning And Conceptualisation Of The VBA Task
01:04 Create A New Macro
01:29 Declaring A VBA Variable
01:54 Create The First VBA Loop
02:39 Combine A Loop With The VBA Offset Method
03:34 Combine A VBA Variable With The Offset Method
04:59 Declare A Second VBA Variable
05:09 Embed One Loop In Another Loop In VBA
05:19 Annotate A VBA Routine
07:39 Initialise A VBA Variable
08:29 Increment Up A VBA Variable With a = a + 1
10:09 Experimenting With Different VBA Loop Control Values
10:49 Use A Named Range As An 'Anchor Point'
12:09 Explanation Of The Complete Line Of Code
12:44 How To Access Secret Excel VBA Tutorials!
 

The MM LITE series features shortened videos from our exclusive Members' Monday community live sessions.  Want to watch a full one-hour tutorial from our Members' Monday Excel VBA learning community, for free?  What are you waiting for?  Sign up for the FREE MM Taster sessions here:

In Members' Monday you get 2 monthly live sessions with Chris and a small group of like-minded learners, access to an exclusive community forum and the unique 'content navigator' tool to get you where you need to go in the MM content library.  It's a unique Excel (VBA) learning resource designed for serious learners only that will take your data analysis to the next level.