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

creating do until loop

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Creating a do until loop inside a do until loop

Creating a do until loop inside a do until loop

ResolvedVersion 2010

Creating a do until loop inside a do until loop

Afternoon all. I am trying to nest a do until loop inside another do until loop, i understand this logic wont work so whats the best way to perform this function, this is what i have done so far. (both loops work in their own right just not when put together:

Do Until ActiveCell = ""
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("List").Select
ActiveSheet.Paste
ActiveCell.Offset(1, 0).Select

Do Until ActiveCell.Offset(-1, 6) = 1
If ActiveCell.Offset(-1, 6) > 1 Then
ActiveCell.Offset(-1, 0).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
ActiveCell.Offset(1, 0).Select
ActiveSheet.Paste
ActiveCell.Offset(0, 6).Select
ActiveCell.FormulaR1C1 = "=R[-1]C-1"
ActiveCell.Offset(1, -6).Select
End If
Loop

Sheets("Paste ").Select
ActiveCell.Offset(1, 0).Select

Loop

any help would be appreciated

RE: creating a do until loop inside a do until loop

please ignore, manged to fix it

 

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:

Use the Format Painter to copy formatting more than once in Excel

The format painter tool provides a quick and easy way to copy formatting from one cell to another in Word.

The only problem is that if you click the Format Painter once to turn it on, you can only click and drag over a single cell or adjacent range of cells; then the Format Painter turns itself off automatically.

If you want to copy formatting to cells or groups of cells that are not adjacent to each other, double-click the Format Painter - this way you will be able to copy formatting to multiple cells.

When you have finished using Format Painter, press the Esc key or click on the Format Painter button once to turn it off.

View all Excel hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.09 secs.