Hi guys. I am trying to run a formula =xlqprice(Sym,"yahoo") in E1 and at the same time run a loop on column A. I used record macro to see what it looked like
in code. I then inserted it in the loop as you can see. What is supposed to happen is while the loop is running thru column A each time the loop changes symbols
the formula is to change the market price. in E1. I cannot get the formula to run except when the loop reaches the end in column A. I think I am close to getting
the formula to run. I am sending the macro for you to look at. Any help? Thanks.
Sub ProcessData()
x = 1
While ActiveSheet.Range("a" & x).Formula <> ""
Range("E1").Select
ActiveCell.FormulaR1C1 = "=xlqPrice(RC[-1],""tda"")"
Range("J28").Insert xlDown
Range("J28").Value = Range("J27").Value
ActiveSheet.Range("D1").Formula = ActiveSheet.Range("a" & x).Formula
ltime = Timer()
While Timer() - ltime < 7
DoEvents
Wend
x = x + 1
Wend
End Sub
in code. I then inserted it in the loop as you can see. What is supposed to happen is while the loop is running thru column A each time the loop changes symbols
the formula is to change the market price. in E1. I cannot get the formula to run except when the loop reaches the end in column A. I think I am close to getting
the formula to run. I am sending the macro for you to look at. Any help? Thanks.
Sub ProcessData()
x = 1
While ActiveSheet.Range("a" & x).Formula <> ""
Range("E1").Select
ActiveCell.FormulaR1C1 = "=xlqPrice(RC[-1],""tda"")"
Range("J28").Insert xlDown
Range("J28").Value = Range("J27").Value
ActiveSheet.Range("D1").Formula = ActiveSheet.Range("a" & x).Formula
ltime = Timer()
While Timer() - ltime < 7
DoEvents
Wend
x = x + 1
Wend
End Sub