+ Reply to Thread
Results 1 to 4 of 4

logging columns of data when it auto updates

  1. #1
    Registered User
    Join Date
    09-20-2017
    Location
    Ireland
    MS-Off Ver
    2016
    Posts
    3

    logging columns of data when it auto updates

    Hi all...I've been dipping in and out of this really useful forum to improve my Excel skills immensely...so thanks for the help. I am however struggling to solve what is probably a fairly straight forward bit of coding...something until last week I had no experience with.

    I have a regularly updating set of numerical values (every 15 minutes) in a particular column (F1:F50). They each correspond to the water level at 50 different monitoring stations (i.e. each line is a monitoring station). Whenever any of these values change I would like the entire column of previous values to be copied into another column on a separate 'log' sheet - this would then be used as a record and a way of looking for trends. I have managed of sorts to get elements of this task working however getting it all to come together and by column rather than row has proven beyond my abilities. In summary what I would like to achieve is as follows:

    1) Values are updated in column F (F1:F50) by way of a data link from a website (this is up and running so all good here).
    2) The code sees a change in values, and triggers an action. Note that although all cells will update, the actual values may not change for each station. Hence the trigger will need to be if any values in the whole column change. As 80% of the values will always change perhaps the most straightforward way to do this would be that if a total of the column changes, say cell F51. (i.e. if F51 changes, F1:F50 previous values are copied).
    3) Column F (F1:F50) previous values are copied into column D on the log sheet (or new values if this is not possible)
    4) Values update automatically again in column F
    5) Column F (F1:F50) previous values are copied into next column (column E) on the log sheet
    6) Values update automatically again in column F
    7) Column F (F1:F50) previous values are copied into next column (column F) on the log sheet.....etc....etc...
    8) To put the icing on the cake it would be great if this could happen a maximum of 96 times (1 day of data), i.e. 96 columns, before the spreadsheet started over-writing the first column in the log sheet.

    Hope someone here can put me on the right track!

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: logging columns of data when it auto updates

    Try the Worksheet_Change event in the sheet module:

    Please Login or Register  to view this content.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Registered User
    Join Date
    09-20-2017
    Location
    Ireland
    MS-Off Ver
    2016
    Posts
    3

    Re: logging columns of data when it auto updates

    Thanks XLAdept. That put me on the right track. Got sidetracked on something else for a while but with some more browsing I cobbled this together:

    Please Login or Register  to view this content.
    It's probably a bit ropey and could be improved but it does the job (for example it copies to second column in the second sheet initially but this is actually useful as I have other data for column 1)

    One thing that has me stuck is how to copy values and not formulas...is there a simple adjustment to the code or do I need to go down the copy and paste command route? I've tried this but no joy.

  4. #4
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: logging columns of data when it auto updates

    You're welcome and thanks for the rep!

    To paste values:

    Please Login or Register  to view this content.

+ 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. [SOLVED] Auto-logging out
    By Kevin# in forum Suggestions for Improvement
    Replies: 4
    Last Post: 01-07-2016, 11:36 AM
  2. Highlighting cell updates and logging them to a new sheet
    By JustTrying9 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-15-2015, 12:44 PM
  3. How to create a chart that auto updates data as well as ranges?
    By exclusiveicon in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 06-06-2014, 04:27 AM
  4. Logging PLC read data into new columns instead of it being overwritten
    By wedyckjp in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-11-2013, 05:00 PM
  5. Auto Print / Data Logging
    By Invert in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-26-2013, 04:31 PM
  6. Auto Updates by moving columns
    By Brento in forum Excel General
    Replies: 0
    Last Post: 07-15-2006, 05:34 PM
  7. Is there a way to automatically add columns as the data updates?
    By Eric D. in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-24-2005, 02:06 AM

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