+ Reply to Thread
Results 1 to 2 of 2

Add error check and write not found item to a worksheet

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

    Add error check and write not found item to a worksheet

    This macro pulls a stock symbol from the first column of the "ActiveStockSymbols" worksheet. It then goes to the Internet/BarChart.com an gets the historical stock data for the symbol, and inserts the data into the "BackTest" worksheet for processing...… Works great so far! It steps through the list UNTIL it acquires a stock symbol that is no longer active in the stock market. The process comes to a grinding halt. I need to add an error checking routine to catch those symbols, add them to the 1st column in a worksheet called "InvalidStockSymbols" and then get the next symbol from the "ActiveStockSymbols" worksheet and continue through the entire list.

    I apologize for the comment lines in the script, but that is the only way I can remember what I was trying to have that section of code do. I have no clue as to how to insert the proper code to accomplish this. This may not be the most efficient code, but it does work.

    Any assistance will GREATLY be appreciated.
    Don

    Please Login or Register  to view this content.

  2. #2
    Valued Forum Contributor PaulSP8's Avatar
    Join Date
    11-21-2017
    Location
    Chorley, England
    MS-Off Ver
    2013 & 2021
    Posts
    437

    Re: Add error check and write not found item to a worksheet

    Sorry, I don't know what a stock symbol is and you've not provided any examples.

    It sounds as though you need to look at a way to deal with the Errors though which will allow you to capture the rogue symbol, you'd probably be looking at "On Error"

    Take a look at this link and see if it helps you out any; http://www.cpearson.com/excel/errorhandling.htm

    If you need more help then post back with an example of the stock symbols

+ 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. Run Time Error: Item with specified name not found
    By Joseph9098 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 05-29-2018, 05:49 PM
  2. [SOLVED] Error: Item Text not found in Shapes Collection
    By ell_ in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 01-15-2018, 11:11 PM
  3. runtime error '-2147024809 (80070057)' The item with the specified name wasn't found
    By jigarrathod in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-05-2017, 09:18 PM
  4. Replies: 2
    Last Post: 05-13-2014, 07:07 AM
  5. [SOLVED] Run Time Error 3265 - Item not found in this collection
    By Sc0tt1e in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-23-2013, 07:19 AM
  6. Replies: 1
    Last Post: 11-17-2012, 11:10 PM
  7. [SOLVED] How do I know on which worksheet an item is found?
    By Talar in forum Excel General
    Replies: 2
    Last Post: 06-21-2006, 07:00 AM

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