+ Reply to Thread
Results 1 to 20 of 20

Help with taking a snapshot of a cell at specific time of day and copying to a sheet

  1. #1
    Registered User
    Join Date
    05-09-2014
    MS-Off Ver
    Excel 2003
    Posts
    41

    Help with taking a snapshot of a cell at specific time of day and copying to a sheet

    I have a live data feed into Excel that changes all day. I would like to track a certain cell (which I have already have a formula) to copy that number to another sheet at 4:15 central time every Mon-Fri. Is there a way to do this?? Thanks! Mark

  2. #2
    Valued Forum Contributor
    Join Date
    10-26-2008
    Location
    Birmingham, UK
    MS-Off Ver
    All versions up to 2010
    Posts
    1,025

    Re: Help with taking a snapshot of a cell at specific time of day and copying to a sheet

    Hi
    You can use the Application.OnTime vba statement for this. Such as:

    Private Sub Workbook_Open()
    Application.OnTime Now + TimeValue("00:16:15"), "my_Procedure"
    End Sub

    This will call the macro "my_procedure" at 4.15. So you could record a macro to copy the required value to another designated cell and then call that macro in the procedure above. Replace the "my_procedure" with your own macros name.
    The above procedured needs to be placed behind the worksheet and NOT in a module.
    Hope this helps.
    Good luck.
    Tony

  3. #3
    Registered User
    Join Date
    05-09-2014
    MS-Off Ver
    Excel 2003
    Posts
    41

    Re: Help with taking a snapshot of a cell at specific time of day and copying to a sheet

    Hi Tony, okay, I am trying this:


    Sub AvgAge()
    Application.OnTime Now + TimeValue("00:16:15"), "avgage"
    End Sub
    Sub AvgAge1()
    '
    '

    '
    Range("B2").Select
    ActiveCell.FormulaR1C1 = "=TODAY()"
    Range("C2").Select
    ActiveCell.FormulaR1C1 = "='Average Age'!RC[6]"
    Range("C3").Select
    End Sub

    I am confused on how i can automatically add the date and data from my cell. In other words, I want to create a column of the date with the data next to it and each day it automatically adds to the bottom of the data.

  4. #4
    Valued Forum Contributor
    Join Date
    10-26-2008
    Location
    Birmingham, UK
    MS-Off Ver
    All versions up to 2010
    Posts
    1,025

    Re: Help with taking a snapshot of a cell at specific time of day and copying to a sheet

    Hi Mark
    Are you able to post a sample workbook, with anonymised data if neccessary, so I can see how you are referencing RC[6] on the Average Age worksheet.
    Thanks
    Tony

  5. #5
    Registered User
    Join Date
    05-09-2014
    MS-Off Ver
    Excel 2003
    Posts
    41

    Re: Help with taking a snapshot of a cell at specific time of day and copying to a sheet

    Hi Tony - thanks for the reply. I created a worksheet that shows what I am looking to do. I am new at macros and VB so thanks for your help!
    Attached Files Attached Files

  6. #6
    Valued Forum Contributor
    Join Date
    10-26-2008
    Location
    Birmingham, UK
    MS-Off Ver
    All versions up to 2010
    Posts
    1,025

    Re: Help with taking a snapshot of a cell at specific time of day and copying to a sheet

    Hi Mark
    You will need to test this properly.
    There i some code in the Module "This Workbook" page which runs when the Workbook is first opened.
    Finges crossed it works.
    Let me know.
    Tony
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    05-09-2014
    MS-Off Ver
    Excel 2003
    Posts
    41

    Re: Help with taking a snapshot of a cell at specific time of day and copying to a sheet

    Tony

    Thanks! I will change the reference cell and see that happens at 4:15 today

    Thanks again!!
    Mark

  8. #8
    Registered User
    Join Date
    05-09-2014
    MS-Off Ver
    Excel 2003
    Posts
    41

    Re: Help with taking a snapshot of a cell at specific time of day and copying to a sheet

    I left the sheet open yesterday but it did not pull the figure at 4:15.

    Dumb question, but in the VB it references "my_procedure" Is this something I am suppose to do separately?

  9. #9
    Valued Forum Contributor
    Join Date
    10-26-2008
    Location
    Birmingham, UK
    MS-Off Ver
    All versions up to 2010
    Posts
    1,025

    Re: Help with taking a snapshot of a cell at specific time of day and copying to a sheet

    Hi Mark

    It was not a dumb question - I forgot to create the "my_procedure" macro in a separate module.
    Well spotted.
    Try the attached.
    Tony

    Note: You can change the time for testing purposes then change it back when you are happy.
    Attached Files Attached Files
    Last edited by ARGK; 06-16-2014 at 03:59 AM.

  10. #10
    Registered User
    Join Date
    05-09-2014
    MS-Off Ver
    Excel 2003
    Posts
    41

    Re: Help with taking a snapshot of a cell at specific time of day and copying to a sheet

    Thanks - added that in. I changed the time to test it and nothing happened. Do I need to activate it somehow or will it just run automatically?

  11. #11
    Valued Forum Contributor
    Join Date
    10-26-2008
    Location
    Birmingham, UK
    MS-Off Ver
    All versions up to 2010
    Posts
    1,025

    Re: Help with taking a snapshot of a cell at specific time of day and copying to a sheet

    Hi Mark
    Sorry for the delay.
    Plesae see the attached workbook which I HAVE tested and it works now. That will teach me to stop trying to do things in a rush .
    Again change the time for testing then change it back.
    Hope this helps.
    Tony

  12. #12
    Registered User
    Join Date
    05-09-2014
    MS-Off Ver
    Excel 2003
    Posts
    41

    Re: Help with taking a snapshot of a cell at specific time of day and copying to a sheet

    Thanks - when I run it manually (click the play button) it works. But, it does not run automatically if I change the date. I change the date to a few minutes out and close the VB window and watch and nothing happens. Is it a security setting??

  13. #13
    Registered User
    Join Date
    05-09-2014
    MS-Off Ver
    Excel 2003
    Posts
    41

    Re: Help with taking a snapshot of a cell at specific time of day and copying to a sheet

    Tony - actually, I realized i did not save and close and reopen. It works. How do I get it to create a column of info or add to the data each day so I can chart it? Right now, it just overwrites the cell

    Mark

  14. #14
    Valued Forum Contributor
    Join Date
    10-26-2008
    Location
    Birmingham, UK
    MS-Off Ver
    All versions up to 2010
    Posts
    1,025

    Re: Help with taking a snapshot of a cell at specific time of day and copying to a sheet

    Hi Mark
    I believe this is because Row 1 is empty. Just add something in C1 even if you change the font colour to White and it will work.
    Hope this helps.
    Good luck.
    Tony

  15. #15
    Registered User
    Join Date
    05-09-2014
    MS-Off Ver
    Excel 2003
    Posts
    41

    Re: Help with taking a snapshot of a cell at specific time of day and copying to a sheet

    it works!!! Thanks so much!!

  16. #16
    Valued Forum Contributor
    Join Date
    10-26-2008
    Location
    Birmingham, UK
    MS-Off Ver
    All versions up to 2010
    Posts
    1,025

    Re: Help with taking a snapshot of a cell at specific time of day and copying to a sheet

    Thanks for the feedback Mark.

  17. #17
    Registered User
    Join Date
    05-16-2019
    Location
    US
    MS-Off Ver
    win10
    Posts
    1

    Re: Help with taking a snapshot of a cell at specific time of day and copying to a sheet

    Is There a way to do this without having to close the worksheet?

  18. #18
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: Help with taking a snapshot of a cell at specific time of day and copying to a sheet

    Morcom, welcome to the forum

    Administrative Note:

    Welcome to the forum.

    We are happy to help, however whilst you feel your request is similar to this thread, experience has shown that things soon get confusing when answers refer to particular cells/ranges/sheets which are unique to your post and not relevant to the original. Please start a new thread - See Forum rule #4

    If you are not familiar with how to start a new thread see the FAQ: How to start a new thread
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  19. #19
    Registered User
    Join Date
    12-21-2020
    Location
    Hanover, Ontario
    MS-Off Ver
    Excel
    Posts
    1

    Re: Help with taking a snapshot of a cell at specific time of day and copying to a sheet

    I want something similar, except with numerous cells at numerous times of day....
    attached is the one I am working with.
    The 'Station Management' is the sheet that updates automatically and I want the cells in "Totals Worksheet' to contain the referenced cells' data from the specified time above.
    Attached Files Attached Files

  20. #20
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: Help with taking a snapshot of a cell at specific time of day and copying to a sheet

    Quote Originally Posted by bstorrey View Post
    I want something similar, except with numerous cells at numerous times of day....
    attached is the one I am working with.
    The 'Station Management' is the sheet that updates automatically and I want the cells in "Totals Worksheet' to contain the referenced cells' data from the specified time above.
    Perhaps you missed my post IMMEDIATELY above yours??
    Administrative Note:

    Welcome to the forum.

    We are happy to help, however whilst you feel your request is similar to this thread, experience has shown that things soon get confusing when answers refer to particular cells/ranges/sheets which are unique to your post and not relevant to the original.

    Please see Forum Rule #4 about hijacking and start a new thread for your query.

    If you are not familiar with how to start a new thread see the FAQ: How to start a new thread

+ 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] Copying Spreadsheet taking extremely long time
    By mgs73 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-17-2014, 12:45 AM
  2. [SOLVED] return a snapshot of a cell value at a designated time
    By Mokwit in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-16-2013, 01:25 AM
  3. Replies: 4
    Last Post: 08-02-2012, 12:48 PM
  4. Taking non uniform data from one sheet and copying and organizing it into another sheet
    By worldrenowned in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-08-2012, 03:16 AM
  5. Need Macro/Formula for taking a snapshot of data
    By Fred M in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-09-2010, 04:37 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