Code for copying columns of data when it auto updates to create log


New Member
Sep 25, 2017
Hi all...I've been dipping in and out of this really useful forum to improve my Excel skills 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!

Some videos you may like

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)

Watch MrExcel Video

Forum statistics

Latest member

This Week's Hot Topics

  • Finding issue in If elseif else with For each Loop
    Finding issue in If elseif else with For each Loop I have tried this below code but i'm getting in Y column filled with W005. Colud you please...
  • MsgBox Error
    Hi Guys, I have the below error show up when i try and run my macro in File1 but works fine if i copy and paste the same code into file2. [ATTACH...
    My Cell Format is [B]""0.00" Cr". [/B]But in the cell, it is showing 123.00 for editing. (123 is entry figure). (Data imported from other...
  • Show numbers nearly the same
    Is this possible. I have a number that can change very time eg 0.00001234 Then I have a lot of numbers 0.0000001, 0.0000002, 0.00000004...
  • Please i need your help to create formula
    I need a formula in cell B8 to do this >>if b1=1 then multiply ( cell b8) by 10% ,if b1=2 multiply by 20%,if=3 multiply by 30%. Thank you in...
  • Got error while adding column and filter
    Got error while adding column and filter In column Z has some like "Success" and "Error". I want to add column in AA if the Z cell value is...