paul.warkentin 0 Newbie Poster

Hi, first, let me say this seems the best site I have come across for some great education and discussions... much appreciated! I am now to VBA and have a macro that I want to run until I get a particular message "#VALUE!" in a particular cell "B2". So far saw lots of Do Until loop with various options, have played with different ideas, but nothing working. My current code goes through 194 loop because that is the extent of data I have on another worksheet, but want to trigger the do until to stop not at a certain amount of loops but when last row, which generates the #VALUE! so that should be the cue to stop. Any input great appreciated. Thanks, Paul

Here is my current code:

Sub RunShoes1()
'
' RunShoes1 Macro
'
' Keyboard Shortcut: Ctrl+r
'
Dim i As Integer
i = 0
Do Until i = 196
i = i + 1
Range("A4").Select
ActiveCell.FormulaR1C1 = i + 1
Range("A2:J2").Select
Selection.Copy
Range("A13").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=False, Transpose:=False
Application.CutCopyMode = False
Selection.EntireRow.Insert , CopyOrigin:=xlFormatFromLeftOrAbove
Loop

End Sub