+ Reply to Thread
Results 1 to 4 of 4

Macro to Run through list of stock ticker symbols

  1. #1
    Registered User
    Join Date
    07-11-2014
    Location
    Florida, USA
    MS-Off Ver
    2010
    Posts
    5

    Macro to Run through list of stock ticker symbols

    I'm trying to run a macro to pull key stock statistics from finance.yahoo.com from a list of ticker symbols without having to individually select the tickers. I'm also trying to format the data in the macro as well, but I can certainly do this after the fact if it's not possible.

    This is what I've gotten so far:

    Sub Macro6()
    '
    ' Macro6 Macro
    '
    ' Keyboard Shortcut: Ctrl+n
    '
    ActiveCell.Select
    With ActiveSheet.QueryTables.Add(Connection:= _
    "FINDER;C:\Users\user\Documents\Personal\Key Stock Statistics.iqy", _
    Destination:=ActiveCell.Offset(0, 0))
    .Name = "Key Stock Statistics_35"
    .FieldNames = True
    .RowNumbers = False
    .FillAdjacentFormulas = False
    .PreserveFormatting = True
    .RefreshOnFileOpen = False
    .BackgroundQuery = True
    .RefreshStyle = xlInsertDeleteCells
    .SavePassword = False
    .SaveData = True
    .AdjustColumnWidth = True
    .RefreshPeriod = 0
    .WebSelectionType = xlSpecifiedTables
    .WebFormatting = xlWebFormattingNone
    .WebTables = "9,12,14,16,18,20,22,26,28,30"
    .WebPreFormattedTextToColumns = True
    .WebConsecutiveDelimitersAsOne = True
    .WebSingleBlockTextImport = False
    .WebDisableDateRecognition = False
    .WebDisableRedirections = False
    .Refresh BackgroundQuery:=False
    End With
    ActiveCell.Offset(0, 0).Range("A1:A76").Select
    Selection.Delete Shift:=xlToLeft
    ActiveCell.Cells.Select
    ActiveCell.Cells.EntireColumn.AutoFit
    End Sub

    My ticker symbols are in row 1 and my descriptions for the data are in column A. Any help would be greatly appreciated!

  2. #2
    Forum Expert
    Join Date
    10-09-2012
    Location
    Dallas, Texas
    MS-Off Ver
    MO 2010 & 2013
    Posts
    3,049

    Re: Macro to Run through list of stock ticker symbols

    Post a sample workbook instead.
    Please ensure you mark your thread as Solved once it is. Click here to see how.
    If a post helps, please don't forget to add to our reputation by clicking the star icon in the bottom left-hand corner of a post.

  3. #3
    Registered User
    Join Date
    07-11-2014
    Location
    Florida, USA
    MS-Off Ver
    2010
    Posts
    5

    Re: Macro to Run through list of stock ticker symbols

    Thanks for your reply. I'll work on uploading one. The only issue I see is that the I'm attempting to run a query saved on my machine, but I guess I can attach that as well.

  4. #4
    Registered User
    Join Date
    07-11-2014
    Location
    Florida, USA
    MS-Off Ver
    2010
    Posts
    5

    Re: Macro to Run through list of stock ticker symbols

    I've attached the excel file I'm using to pull in the key stock statistics, the query I'm using is a simple query from finance.yahoo.com. I'm also open to alternatives.
    Attached Files Attached Files

+ 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. Replace old ticker symbols
    By worswick25 in forum Excel - New Users/Basics
    Replies: 8
    Last Post: 09-14-2011, 01:29 PM
  2. Pulling certain info from Yahoo Finance without ticker symbols
    By wolfy in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-08-2009, 11:37 AM
  3. the # of data records that correspond to the ticker symbols
    By excelbear in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 12-16-2007, 06:36 PM
  4. [SOLVED] Getting Stock Ticker Value
    By Tina in forum Excel General
    Replies: 4
    Last Post: 08-11-2005, 09:05 AM
  5. Recognize more stock ticker symbols?
    By Bob in forum Excel General
    Replies: 2
    Last Post: 01-26-2005, 03:06 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