My code is below. It currently runs a loop 10 times, but I want 2 variations of it.
1) How can I edit it so that it runs n number of times, where n is the value of cell A1 (which I hardcode / is static prior to the code being run)
2) How do I edit it so that it runs as long as a condition is true? (Say...while the value of cell B1 is less than 5, when B1 changes value as the Loops are running...
1) How can I edit it so that it runs n number of times, where n is the value of cell A1 (which I hardcode / is static prior to the code being run)
2) How do I edit it so that it runs as long as a condition is true? (Say...while the value of cell B1 is less than 5, when B1 changes value as the Loops are running...
VBA Code:
Sub Loop_Clumps()
Dim i As Long
For i = 1 To 10
Range(Range("next_clump").Value).Replace What:="||", Replacement:="=", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Application.Wait (Now + TimeValue("0:00:01"))
Next i
Application.CutCopyMode = False
End Sub