Hi,
First time poster so I'll do my best to include all relevant info.
I have created an excel file that summarises my shareholding information and automatically updates the current price when I press a refresh button.
Each time I press the refresh button, I'd like to record the date, the cost (stored in 25,5), and the market value (stored in 25,7) of the shares, and display this in a chart (date vs cost&market value). To do so I have the following code:
Static cnt As Long
cnt = cnt + 1
W.Cells(5, 18) = cnt
W.Cells(cnt, 19) = Date
W.Cells(cnt, 20) = W.Cells(25, 5)
W.Cells(cnt, 21) = W.Cells(25, 7)
The problem is, every time I close my file and re-open it, Count resets to 0 so my data log enters over previous data (I use this data log to make the chart).
It works fine when it is left open. Can someone help me maintain the value of count between sessions? Or suggest other alternative solutions?
Thanks!
Jordan
Bookmarks