Maybe:
Sub WaitExample()
Dim Rw As Long, Mycode As String, WaitTime As Long
Mycode = CStr(Application.InputBox("What is the ticker number?", "Ticker number", 5122, Type:=2))
If Mycode = "False" Then Exit Sub
WaitTime = Application.InputBox("What is the wait time in seconds?", "Wait time", 15, Type:=1)
For Rw = 2 To Range("A" & Rows.Count).End(xlUp).Row Step 1000
Range("A" & Rw).Resize(1000).FormulaR1C1 = "=BPD(security ticker, RC1, " & Mycode & ")"
Application.Wait Now + TimeValue("00:00:" & Format(WaitTime, "00)"))
Next Rw
End Sub
Bookmarks