+ Reply to Thread
Results 1 to 3 of 3

Data Logging Assistance

  1. #1
    Registered User
    Join Date
    08-21-2016
    Location
    Adelaide, Australia
    MS-Off Ver
    14.0
    Posts
    2

    Data Logging Assistance

    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

  2. #2
    Forum Expert
    Join Date
    04-01-2013
    Location
    East Auckland
    MS-Off Ver
    Excel 365
    Posts
    1,343

    Re: Data Logging Assistance

    maybe write the value to a cell somewhere on the sheet?

    Please Login or Register  to view this content.
    (A1 just being an example cell)

    BTW you should put your code in code tags.. Select it and press the # symbol you see above the text box.

  3. #3
    Registered User
    Join Date
    08-21-2016
    Location
    Adelaide, Australia
    MS-Off Ver
    14.0
    Posts
    2
    Thanks scottie that worked perfectly! Cheers

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 1
    Last Post: 08-11-2015, 04:07 PM
  2. Logging Data Using a Timer?
    By gravitycat in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-05-2015, 08:36 PM
  3. Excel 2007 : Logging XML/RSS data
    By pgh1212 in forum Excel General
    Replies: 0
    Last Post: 07-22-2010, 09:52 PM
  4. Logging data with DDE link
    By whtrader in forum Excel General
    Replies: 1
    Last Post: 12-05-2006, 10:13 AM
  5. [SOLVED] Logging data using the same textfile over and over again
    By Silencer116 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-22-2006, 07:15 AM
  6. Live DDE Data Logging
    By MadManInABox in forum Excel General
    Replies: 1
    Last Post: 09-19-2005, 05:05 AM
  7. Logging Data Single Input
    By ExcelDanHarris in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-09-2005, 01:05 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1