From the course: Excel: Macros in Depth (Microsoft 365)

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Using loop structures in context

Using loop structures in context

From the course: Excel: Macros in Depth (Microsoft 365)

Start my 1-month free trial

Using loop structures in context

- [Instructor] In the previous movie, we recorded the macro that took the data for each person here and transposed it into column D. And we did this for four sets of names. The code that we generated here is repetitious. Let's take a look at it, ALT + F11. We're looking at the workbook called partial two. So when you're in this environment here, make sure that partial two, over here, is visible and module one, double-click it just to make sure that the code we're looking at is based on what was done in the previous movie. Now I did introduce some lines in the meantime to clarify the repetition here. But here's the code that got recorded. And because we copied the information immediately to the right, two cells to the right, we always stay to the same row as the source data, this code repeats. And obviously we don't want to keep doing this for all the data we type forever. As soon as we recognize that the code is repeating,…

Contents