creating do until loop

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 » Creating a do until loop inside a do until loop | Excel forum

Creating a do until loop inside a do until loop | Excel forum

resolvedResolved · Low Priority · Version 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:

Fill formulae across a sheet

To copy a formula down a spreadsheet where there is data underneath, to the left or to the right of the formula, double-click on the fill handle. The fill handle is the little black cross that appears in the bottom right-hand corner of the formula cell. Unfortunately, no similar facility exists to copy formulae across the sheet.

One reasonably quick way to copy an existing formula across a sheet is to select the formula and the cells on the right to which you want to copy it. Then press Ctrl+R to copy the formula across the selected range, or, if you are menu-minded, use the Edit|Fill|Right command.

View all Excel hints and tips


Server loaded in 0.08 secs.