+ Reply to Thread
Results 1 to 5 of 5

Stock Data Type: Error Type mismatched

  1. #1
    Forum Contributor
    Join Date
    09-10-2016
    Location
    USA
    MS-Off Ver
    Office 365
    Posts
    680

    Stock Data Type: Error Type mismatched

    Reference information: https://support.microsoft.com/en-us/...8-f1a89e210877

    Sample screenshot attached, below is sample code.

    Question: I would like to check if the cell has company or not, in sample screenshot, the IF statement should return False, but it runs into error --- Type mismatched.

    How to fix my code?

    To make my question clearer: how to determine if a cell has stock data -- Company ?

    Thanks

    Please Login or Register  to view this content.
    Stock Data.JPG
    Last edited by VAer; 12-11-2021 at 09:43 PM.

  2. #2
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,223

    Re: Stock Data Type: Error Type mismatched

    Please Login or Register  to view this content.
    Artik

  3. #3
    Forum Contributor
    Join Date
    09-10-2016
    Location
    USA
    MS-Off Ver
    Office 365
    Posts
    680

    Re: Stock Data Type: Error Type mismatched

    Thanks, it works for my program. But technically, it seems that Stock Data is subset of RichDataType. Sounds that they are not same, there must be other types of RichDataType.

  4. #4
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,223

    Re: Stock Data Type: Error Type mismatched

    I don't think you will find this type of detail in VBA. This may be because types are handled by third-party add-ins.
    One solution may be an intermediate check on the content in the cell. In the case of the Stocks type, the stock symbol and company symbol are required, e.g. (XNAS:MSFT), (XNAS:AAPL), (XNYS:TSN). You can check if the content of the cell matches the pattern, e.g.
    Please Login or Register  to view this content.
    Artik

  5. #5
    Forum Contributor
    Join Date
    09-10-2016
    Location
    USA
    MS-Off Ver
    Office 365
    Posts
    680

    Re: Stock Data Type: Error Type mismatched

    Thanks. I learn one more thing from your post, checking Cell.Formula . I did not know that before. I only know checking cell value Cell.Value

+ 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. Stock Data Type: Counting cells with question mark?
    By VAer in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-18-2021, 11:32 PM
  2. VBA for Stock Data Type
    By VAer in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-18-2021, 01:38 PM
  3. Run-time error '13'. Type mismatch when referring to Stock Data.
    By fpt264 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-28-2019, 07:06 PM
  4. [SOLVED] type mismatched error 13 on general text ???
    By incobart in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-02-2018, 01:14 PM
  5. [SOLVED] wheres my type mismatched??
    By bdrilling33 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-10-2014, 08:30 AM
  6. Stock-type chart with 5 data series
    By josh83 in forum Excel General
    Replies: 2
    Last Post: 01-07-2011, 12:40 AM
  7. [SOLVED] Help: Compile error: type mismatch: array or user defined type expected
    By lvcha.gouqizi in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-31-2005, 05:05 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