+ Reply to Thread
Results 1 to 8 of 8

Convert program to loop throug a list of stock symbols from one at a time

  1. #1
    Registered User
    Join Date
    12-31-2012
    Location
    Florida
    MS-Off Ver
    Excel 2016 - 365
    Posts
    54

    Convert program to loop throug a list of stock symbols from one at a time

    Well, I have stumbled my way through all kinds of programming roadblocks and managed (with a lot of trial and error and input from you guys) to get all the macros up and running. Now I have the BIGGEST roadblock (challenge... sorry) thus far. The attached script currently runs fine, but I need to convert this code from a single stock symbol manually entered on worksheet "SetUp" (E4) to an automated version that will get the stock symbol from a list worksheet "ActiveStockSymbols" (column "A"). The date range will remain the same as it is now. I believe that I somehow need to loop the code between the "v" and the "^" lines. I found a few macros that I think did this, but they also did a lot of other things, which confused me, so I have no idea as to how I can incorporate a loop into my macro. I really need your assistance on this one. On each download the code copies some output to a ReportSummary worksheet and continues on with the next stock symbol until the list is completed. This macro may not be the best use of code, and I realize that, but I did get it working. I am sure that a lot of other members will be happy to use this macro with their spreadsheets.

    I searched the forum, but if I missed a post that has this request up and running, please let me know what it is.

    Thanks in advance for any assistance you can offer,

    Don

    Please Login or Register  to view this content.
    Last edited by Mustang65; 11-13-2016 at 06:36 PM.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Convert program to loop throug a list of stock symbols from one at a time

    Please Login or Register  to view this content.
    Last edited by AlphaFrog; 11-14-2016 at 05:43 AM.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Convert program to loop throug a list of stock symbols from one at a time

    I have slightly amended your code. If there is an error on the URL due to stock symbol, or date, I put an error trapping, though it is not a good coding practice, it basically makes jump the code in to next loop.
    I have separated the delimiter in to separate code.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    12-31-2012
    Location
    Florida
    MS-Off Ver
    Excel 2016 - 365
    Posts
    54

    Re: Convert program to loop throug a list of stock symbols from one at a time

    The above code works great! Thank you so very much... I have one issue remaining. I am trying to copy the current run's variable "SYMBOL" into worksheet "BackTest" cell "AQ2", I have tried various ways and locations with no success. The last one is in the code below between the up an down indicators. It has to be something dumb that I am doing or not doing.

    AB33 I will be looking at your code as soon as I get this issue resolved, as it will be the same for both.

    Thanks again,

    Don

    Please Login or Register  to view this content.
    Last edited by Mustang65; 11-14-2016 at 07:40 PM.

  5. #5
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Convert program to loop throug a list of stock symbols from one at a time

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    12-31-2012
    Location
    Florida
    MS-Off Ver
    Excel 2016 - 365
    Posts
    54

    Re: Convert program to loop throug a list of stock symbols from one at a time

    Thank you AlphaFrog!!!!!

    Another GREAT job!!!!

    Don

  7. #7
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Convert program to loop throug a list of stock symbols from one at a time

    You're welcome. Thanks for the feedback.

    Do you have a '65 Mustang? I have a 2014 Mustang.

  8. #8
    Registered User
    Join Date
    12-31-2012
    Location
    Florida
    MS-Off Ver
    Excel 2016 - 365
    Posts
    54

    Re: Convert program to loop throug a list of stock symbols from one at a time

    Sorry about the slow response..
    I just sold my 65 Mustang last year... working on it was a REAL pain in the BACK. It was CandyApple red with White stripes, 320Hp.. loved it

    But someone else is enjoying it... would upload pictures ... maybe inside my next spreadsheet

    Don

+ 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. Export pdf from specific Range of cell throug loop
    By rohankumarkshirsagar in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-05-2015, 04:02 AM
  2. [SOLVED] Macro to loop throug the workbook and create charts
    By dobracik in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 03-23-2015, 03:27 PM
  3. Obtain historical stock prices for multiple symbols at the same time
    By ericrichard25 in forum Excel Programming / VBA / Macros
    Replies: 34
    Last Post: 01-17-2015, 09:58 PM
  4. Macro to Run through list of stock ticker symbols
    By johnk13 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-15-2014, 08:48 PM
  5. Excel 2007 : Looking up stock symbols
    By jscpa in forum Excel General
    Replies: 1
    Last Post: 02-27-2012, 03:25 PM
  6. [SOLVED] Web Query With Multiple Stock Symbols & Stock Scouter
    By Manfred in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 03-01-2006, 05:15 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