Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What is the best way of capturing and storing data in a file/database?

Status
Not open for further replies.

Mightyginger

Programmer
Feb 27, 2003
131
US
This is quite a simple idea but before I write everything I just have a really quick question please.

I have 7 cells which have prices in them, these are fed from reuters. Anytime one of the prices change I want to capture all 7 prices. I was going to do this in a database but would a text file be better? (i.e. more compact) Any price might change any time, so I need the saving of the data to be as quick as possible - how fast can excel run the vba and store the data?

So my question is should I be storing the data in a database or a text file and also whats the quickest way of storing the data in that source (can i just open the connection and leave it open?)

Thanks for your help,


Neil.
 
This will append a text file each time any cell changes...

Private Sub Worksheet_Change(ByVal Target As Range)
r = 1
Open "i:\test_auto_append.txt" For Append As #1
x = Date$ + "~" + Time$
Do Until r > 7
Print #1, x + " - " + CStr(Cells(r, 1))
r = r + 1
Loop
Close
End Sub
 
Note: change the path to something more usfull to you.

This also assumes that the col in question is A
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top