+ Reply to Thread
Results 1 to 3 of 3

Record real time data (stock quote)

Hybrid View

  1. #1
    Registered User
    Join Date
    12-20-2014
    Location
    India
    MS-Off Ver
    office 2007
    Posts
    73

    Record real time data (stock quote)

    The Sample excel ‘Record’ contains 2 sheets named ‘RTData’ and ‘Datafeed’ resp.

    This excel is about recording real time data (stock quote) from trading terminal ODIN Diat.

    In Datafeed sheet, we get Time and quote in cells A1 & A2 resp. This is a ‘tick’ data and it refreshes a few times EVERY SECOND.

    I wish to record this data in sheet ‘RTData’. Time in col A, & Quote in col B. (for time interval 10 Sec)

    After searching the forum, I got the following code:


    Sub update()
    
    With Sheets("RTData")
    rw = .Cells(.Rows.Count, 1).End(xlUp).Row + 1
    .Range(.Cells(rw, 1), .Cells(rw, 2)).Value = Sheets("datafeed").Range("a1:b1").Value
    End With
    Application.OnTime Now + TimeSerial(0, 0, 10), "update" ' run again after 10 seconds
    End Sub
    I wish this code / or something better than this (if someone can suggest) with a few modifications:

    1. Controls to start and stop recording.
    2. Something on ‘error handling’

    Can someone please help in this matter ?
    Attached Files Attached Files
    Last edited by chaitreya; 02-26-2015 at 11:29 PM.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2505 Win 11
    Posts
    24,740

    Re: Record real time data (stock quote)

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE] [/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here



    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    12-20-2014
    Location
    India
    MS-Off Ver
    office 2007
    Posts
    73

    Re: Record real time data (stock quote)

    Dear alansidman ,

    I had edited the post as per forum rule 7

    Sorry for the earlier post (without highlighting the code) as this is the first time I am posting any code here.

+ 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. Real-time Stock Prices
    By YAbdelaal in forum Excel General
    Replies: 3
    Last Post: 06-28-2014, 09:47 AM
  2. Replies: 0
    Last Post: 09-23-2012, 12:34 PM
  3. Charting real-time DDE stock prices
    By shawnh in forum Excel Charting & Pivots
    Replies: 5
    Last Post: 03-01-2010, 06:06 PM
  4. Real-time quote on excel Java
    By feejo in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-19-2007, 09:35 AM
  5. Replies: 1
    Last Post: 01-07-2005, 08:06 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