Closed Thread
Results 1 to 5 of 5

macro getting price history online

  1. #1
    Registered User
    Join Date
    07-26-2016
    Location
    Virginia
    MS-Off Ver
    2016
    Posts
    11

    macro getting price history online

    VBN macro

    Hello all,

    In excel tab "data" I click "from web" I add the url: http://www.nasdaq.com/symbol/f/historical

    (when I go to the website normally in the website there is a feature that lets me get data from 1, 5, 10, etc years back.)

    It would be real easy if the 10 year price history was sourced in the url somehow but the option to change the dates to 10 years back doesnt change the url. So I cannot retieve all the data, just the data thats on the initial page (which is like daily data from the previous 3 months.)

    Basically my goal is to write a macro that can pull the full 10 years of a stock out of nasdaq.

    Any solution to this is appreciated.

    Best,

    Chris
    Last edited by knebelcm; 07-29-2016 at 06:52 PM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: macro getting price history online

    Google has a historical feature that allows the entire date range to be downloaded as one CSV file. Here's a file file showing that in use. Set the Nasdaq code you want, and the date range, it presents it all for you automatically.
    (source)
    Attached Files Attached Files
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    07-26-2016
    Location
    Virginia
    MS-Off Ver
    2016
    Posts
    11

    Re: macro getting price history online

    I Really appreciate your post and attachment.

    - Is there a way I could learn how to create a spreadsheet like this attachment from scratch?
    - With the attached spreadsheet you attached I created another tab with the first row of dates (that would be using throughout) and the first column some tickers (I did not attach this spreadsheet). How do I create the macro to click the button? And there is a delay when the button is clicked, so the macro just copies the previous tickers data (because it doesn't update fast enough) I find.

    Basically I want add a bunch of stocks in a column and their price over the previous 10 years to look like this (attachment).

    Thanks so much for your help! I'm new to macro and would like to learn as much as possible.

    Best,

    Chris
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    07-26-2016
    Location
    Virginia
    MS-Off Ver
    2016
    Posts
    11

    Re: macro getting price history online

    Or best yet, how can I take the attachement you gave me and add more tickers to it so I can view multiple close prices over time on one graph? Is there a way I can tweek that spreadsheet you sent me? Its really nice

  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: macro getting price history online

    The attached workbook will allow you to select the startdate, enddate and the price you want reported (OPEN/HIGH/LOW/CLOSE).

    If the first day of the month is a holiday or not reported from Nasdaq history, you will get the last date prior to that day with data.

    I do not suppress errors in this version, to me N/A means "Not available" and is the correct result for a ticker that did not trade at all in the period noted.
    Attached Files Attached Files

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. macro to make a history sheet
    By MetteGaga in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-14-2015, 03:14 AM
  2. [SOLVED] Price search history extracting
    By makinmomb in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-01-2014, 08:13 AM
  3. Replies: 3
    Last Post: 01-03-2013, 12:32 AM
  4. Replies: 4
    Last Post: 08-15-2012, 09:49 AM
  5. Replies: 3
    Last Post: 07-17-2012, 03:34 AM
  6. Replies: 1
    Last Post: 06-22-2012, 01:30 PM
  7. Creating Macro to capture history
    By claudiomonteverdi in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-30-2012, 02:26 AM

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