vba

Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » VBA

VBA

resolvedResolved · Low Priority · Version 2003

Trevor has attended:
Excel Advanced course
Excel VBA Intro Intermediate course
Access Intermediate course
Excel VBA Advanced course

VBA

What is a nested loop?

RE: VBA

Hi Trevor

Thank you for the question. A nested loop is when one loop contains another loop. The example below has a loop for the columns and a loop to do each row in each column.


Sub Square100()
Dim iRowNum As Integer
Dim iColNum As Integer

For iColNum = 0 To 9
For iRowNum = 1 To 10
ActiveCell.Offset(iRowNum, iColNum).Value = iColNum * 10 + iRowNum
Next iRowNum
Next iColNum


End Sub


I hope that explains enough.

Laura GB

 

Training courses

 

Training information:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.


 

Excel tip:

Remove unused toolbar buttons

Are there buttons on your Excel toolbars that you never use? Remove them from the toolbar by doing the following:

1. Go to Tools - Customise - Commands.
2. Select the toolbar button you wish to remove, then use your mouse to drag and drop the button into the Excel window. When you release your finger from the mouse, the button will disappear.

View all Excel hints and tips


Server loaded in 0.08 secs.