+ Reply to Thread
Results 1 to 11 of 11

Want to record value from a live data after each 30 minuts

  1. #1
    Registered User
    Join Date
    01-19-2018
    Location
    Sylhet,Bangladesh
    MS-Off Ver
    2010
    Posts
    4

    Lightbulb Want to record value from a live data after each 30 minuts

    Hi,

    I am new in this forum. Greetings to all.

    I have excel sheet which is linked with a website. some columns of this sheet changes after every thirty minutes.
    But i want to store the value in another cells before it updates from online. For example

    I have web connection in a3:a1071 and this cells value will change after every thirty minutes. Before updating I want to keep a3:a1071 cells data to other cells for every thirty minutes. Such as B3:b1071 for 1st 30 minutes, c3:c1071 for second 30 minutes, d3:d1071 for 3rd next 30 minutes.

    Please help me regarding this matter.

  2. #2
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Want to record value from a live data after each 30 minuts

    Welcome to the forum
    Try this:
    (tested on Excel 2016)

    Amend Sheet1 to correct sheet name

    Run StartTimer and updates occur every 30 minutes (the first update happens 30 minutes later)
    - to test, change the value to 1 to update every minute and the first update happens 1 minute later
    Running StopTimer stops the updating

    Paste into a general module
    Please Login or Register  to view this content.
    Paste into ThisWorkbook module
    Please Login or Register  to view this content.
    Suggested query settings

    QueryProperties.jpg
    Last edited by kev_; 01-20-2018 at 10:56 AM.

  3. #3
    Registered User
    Join Date
    01-19-2018
    Location
    Sylhet,Bangladesh
    MS-Off Ver
    2010
    Posts
    4

    Re: Want to record value from a live data after each 30 minuts

    Dear kev_

    Thanks for your reply. But your provided code is not working on excel 2010. i pasted the code on general module. During save the module it shows compile error, message shows that public constant cannot be accepted. Then i changed it to private but does not worked. My excel version is 2010.

    Public Const cRunIntervalMinutes = 5 ' = 30 minutes
    public Const cRunWhat = "CopyDataAndRefresh" ' the name of the procedure to run
    public Const cDataSheet = "SelectedCoins" ' name of sheet containing the data

  4. #4
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Want to record value from a live data after each 30 minuts

    Have you looked at the link to Chip Pearson's page containing the original code? It contains much more than the code - very informative.
    http://www.cpearson.com/excel/OnTime.aspx
    The code should work with Excel 2010.
    The most likely reason is that a typo has crept in somewhere.
    When I get back to my PC, I will upload a file containing the code for you.
    Click *Add Reputation to thank those who helped you. Ask if anything is not clear

  5. #5
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Want to record value from a live data after each 30 minuts

    Just a thought
    - where did you paste the Constants?
    - they need to be at the TOP of the module BEFORE all procedures

  6. #6
    Registered User
    Join Date
    01-19-2018
    Location
    Sylhet,Bangladesh
    MS-Off Ver
    2010
    Posts
    4

    Re: Want to record value from a live data after each 30 minuts

    Yes , I paste it at the top of all procedure.

  7. #7
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Want to record value from a live data after each 30 minuts

    I am totally baffled by your difficulties

    This I what I did starting from scratch
    - opened a new workbook
    - added a data table of windspeeds from the internet
    - copy/pasted the code from the Thread directly into a General module
    - ran StartTimer
    - it worked without a hitch
    - everything the same the same EXCEPT 30 minutes changed to 1 minute because I did not want to wait

    Workbook attached
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    01-19-2018
    Location
    Sylhet,Bangladesh
    MS-Off Ver
    2010
    Posts
    4

    Re: Want to record value from a live data after each 30 minuts

    Dear Kev_

    Many thanks for your excel sheet.
    yes it is working fine. but in my sheet I was not succeed to modify this to get the result on my preferred column.
    It would be a great help if you please modify this code in my attached sheet. I want to keep BB column data to the next BC to BH
    columns by every 30 minutes interval. So that , this will store data to BC to BH columns by 30,60,90,120,150,180 chronologically.
    I will remember your kind help for longtime!

    Best regards
    Nuhanbd
    Attached Files Attached Files

  9. #9
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Want to record value from a live data after each 30 minuts

    I will look at your workbook tomorrow

  10. #10
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Want to record value from a live data after each 30 minuts

    Procedure Test has been added to your workbook to illustrate how to achieve what you want
    - run in attached workbook with {CTRL} k
    - dummy data included in first few rows of BC:BG to test the procedure
    - range details are printed to the immediate window for testing
    (make immediate window in VBA visible with {CTRL} G OR click View\ImmediateWindow)

    ImmediateWindow.jpg

    VBA needs a way to automatically determine the FirstCell to copy in column BB (in case you insert row above 171 later)
    - NamedRange BB_Header created with RefersTo formula =SelectedCoins!$BB$171
    - NamedRange formula automatically adjusts if you insert a row or column
    - The VBA is told that FirstCell is one row below cell BB_Header

    The PasteTo and CopiedFrom ranges are all determined based on FirstCell

    Please Login or Register  to view this content.
    Attached Files Attached Files

  11. #11
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Want to record value from a live data after each 30 minuts

    see solution in previous post

    In first post you said
    II have web connection in a3:a1071 and this cells value will change after every thirty minutes. Before updating I want to keep a3:a1071 cells data to other cells for every thirty minutes. Such as B3:b1071 for 1st 30 minutes, c3:c1071 for second 30 minutes, d3:d1071 for 3rd next 30 minutes.
    But all those columns were incorrect, and there are Headers placed in row 171 which complicates things

    The solution in post#10 does what you require below your headers in row 171, but what do you want to happen above row 171?

    If you want to include all rows from 3 to 1071 then here is one method to achieve that which is to overwrite the headers and then re-instate them
    - set FirstCell= Range("BB3")
    - Named Range BB_Header is not required and can be deleted
    - the procedure now overwrites your headers in row 171
    - use this syntax to re-instate your headers after pasting occurs
    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. How to keep a record of live data
    By YungButtCheek$ in forum Excel General
    Replies: 7
    Last Post: 09-11-2017, 09:37 AM
  2. Replies: 0
    Last Post: 06-09-2016, 01:06 AM
  3. Excel Live VLookup Live in spreadsheet - Quick way to find them?
    By CHR15T1N4 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-31-2013, 07:33 AM
  4. how to capture /record live quote data
    By beebee in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 05-30-2013, 08:46 AM
  5. SORT angle in degree minuts decimal
    By paascal in forum Excel General
    Replies: 5
    Last Post: 03-03-2013, 01:15 PM
  6. Record Value Change from a Live Feed
    By jk64 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-09-2011, 03:30 AM
  7. how to make a function run every 20 minuts
    By udikafri in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-08-2007, 06:38 PM

Tags for this Thread

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