excel training program - do loop

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

Forum home » Delegate support and help forum » Microsoft Excel Training and help » excel training program - Do Loop

excel training program - Do Loop

resolvedResolved · Low Priority · Version Standard

Kitu has attended:
Excel VBA Intro Intermediate course

Do Loop

What is the difference between the For and Do loops?

RE: Do Loop

Hi Kitu

Thankyou for your question

All loops carry out a series of operations until a condition is met

A For Loop will execute for a predetermined number of loops.

For i = 1 to 100

CODE

Next i

This Will carry out the code will the variable i is less than or equal to 100. i will increase by 1 at every loop, so the code will be run for 100 loops

A DO Loop will typically compare one variable with another variable or a constant and execute the code while a specified condition holds

Do until A > B

CODE

Loop

This will execute the code as long as the variable A is less than the variable B


 

Excel tip:

Reconciling a list to correspond with another

May have a list that needs to make but on another sheet one list seems to be out, eg. product list one sheet contains all product and inventory data, while the other contains pricing data. Both need to match with all products but there is more products in one list than the other. To find the disparaging product compare data in the two columns that need to match Make sure that order the same way.
Create another column in the sheet that has the most items and type in the first cell


=Exact(text1,text2) text1 being the cell that you want compared with text2 cell reference. Drag to filldown and your first false will give you for first cells that does not match. Correct insert the row with data in other sheet and continue the process until all the data returns true. Delete the column inserted.

View all Excel hints and tips


Server loaded in 0.09 secs.