butterfly2000
New Member
- Joined
- Nov 1, 2005
- Messages
- 8
I have a file folder titled "Data" in this folder are 10 .txt files. The data in each file is of the sort:
AAPL 11/08/2005 59.95 60.38 59.10 59.90
AAPL 11/09/2005 60.00 61.21 60.00 60.11
AAPL 11/10/2005 60.64 61.20 59.01 61.18
AAPL 11/11/2005 61.54 62.11 61.34 61.54
AAPL 11/14/2005 61.54 61.98 60.91 61.45
AAPL 11/15/2005 61.60 63.08 61.46 62.28
AAPL 11/16/2005 63.15 65.06 63.09 64.95
AAPL 11/17/2005 65.59 65.88 64.25 64.52
(Stock data... there are 65 lines per file)
I need to:
(a) Plug this data into the worksheet called "datacruncher"
(b) Grab the output in column c, row 3 (which is the result from a bunch of other calculations done on the data) and move this answer, along with the stock ticker, on to a worksheet called "results"
(c) Then I need to repeat this (a, b steps) with the other 9 .txt files). Thus, at the end of running the macro, I will have 10 rows complete on the "results" worksheet, each two columns-- column a with the ticker, column b with the c3 result from the "datacruncher" worksheet.
I have tried to building this macro by using the recorder, because honeslty-- even though I have a rudimentary knowledge of building my own macros using the vba editor... I cannot figure out for the life of me how to get the data in from the txt file and repeat.
Hoping someone can help me out!
Thx
AAPL 11/08/2005 59.95 60.38 59.10 59.90
AAPL 11/09/2005 60.00 61.21 60.00 60.11
AAPL 11/10/2005 60.64 61.20 59.01 61.18
AAPL 11/11/2005 61.54 62.11 61.34 61.54
AAPL 11/14/2005 61.54 61.98 60.91 61.45
AAPL 11/15/2005 61.60 63.08 61.46 62.28
AAPL 11/16/2005 63.15 65.06 63.09 64.95
AAPL 11/17/2005 65.59 65.88 64.25 64.52
(Stock data... there are 65 lines per file)
I need to:
(a) Plug this data into the worksheet called "datacruncher"
(b) Grab the output in column c, row 3 (which is the result from a bunch of other calculations done on the data) and move this answer, along with the stock ticker, on to a worksheet called "results"
(c) Then I need to repeat this (a, b steps) with the other 9 .txt files). Thus, at the end of running the macro, I will have 10 rows complete on the "results" worksheet, each two columns-- column a with the ticker, column b with the c3 result from the "datacruncher" worksheet.
I have tried to building this macro by using the recorder, because honeslty-- even though I have a rudimentary knowledge of building my own macros using the vba editor... I cannot figure out for the life of me how to get the data in from the txt file and repeat.
Hoping someone can help me out!
Thx