Hi guys. I have finally finished writing a code that downloads information on historical stock prices...now I have another problem, here it is:
I have a few columns, A is date, B is open price, C is close price, D is high price...depending on the stock I pull, the number of entries in columns varies (its always very large, >5000)
Here is what I want to do. I want to put columns in arrays, and i am guessing since the number of entries varies, i need to do a dynamic array. so i'll have three arrays for each column (open, close, high)
this is what i am trying to do, i want the code to do the following:
if open price is greater than close price, then i want the high price (from the same date/row) to be multiplied by a 100 and i want that result to show up in the same row in column E.
basically, i am just comparing data in each row and if desired IF statement is satisfied (B>C) then i want E = (D*100) ...i can do this for one row, but i need some kind of a loop that will run down all the rows and do this automatically. i want to write VBA code for this, as everything i have so far is writen from scratch and works very well. im trying to avoid recording macros and do worksheet functions.
can anyone help me with this?
here is what i have so far, which is probably very wrong..im not even sure if i created arrays correctly..
Bookmarks