+ Reply to Thread
Results 1 to 8 of 8

Error 13- "type mismatch" using CountIf function

  1. #1
    Registered User
    Join Date
    07-13-2015
    Location
    Slovakia
    MS-Off Ver
    2007, 2010, 2013
    Posts
    76

    Error 13- "type mismatch" using CountIf function

    Hello, can you help me with this code? Itīs just a simple one but it keeps given me the Error 13- "type mismatch" when i try to define Count variable based the CountIf function. Any suggestions?

    Please Login or Register  to view this content.
    Last edited by jj4jj; 11-21-2015 at 06:46 PM.

  2. #2
    Registered User
    Join Date
    07-13-2015
    Location
    Slovakia
    MS-Off Ver
    2007, 2010, 2013
    Posts
    76

    Re: Simple code problem

    The Workbook variable name is actually "2" so for better understanding:
    Please Login or Register  to view this content.
    Any ideas? PLS

  3. #3
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Simple code problem

    Any chance you could upload a sample workbook?

    Click on GO ADVANCED and use the paperclip icon to open the upload window.
    If posting code please use code tags, see here.

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: Simple code problem

    Please take a moment to read the forum rules and then amend your thread title to something descriptive of your problem - not what you think the answer might be. (think google search terms?). Once you have done this please send me a PM and I will remove this request. (Also, include a link to your thread - copy from the address bar)

    Many members search our previous posts, and thread titles play a big part of the search. I doubt anybody would do a search based on your title?

    To change a Title on your post, click EDIT POST then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    (note: this change is not optional )
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  5. #5
    Registered User
    Join Date
    07-13-2015
    Location
    Slovakia
    MS-Off Ver
    2007, 2010, 2013
    Posts
    76

    Re: Simple code problem

    There are the two files
    Attached Files Attached Files

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: Simple code problem

    jj4jj please read post #4

  7. #7
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    2,760

    Re: CountIf function problem

    The code in the file you uploaded is not the same as in post #1.

    The code you posted, fails on the bolded line because x doesn't have a value when that line is run.
    Did you upload the right file?
    Please Login or Register  to view this content.
    Last edited by skywriter; 11-21-2015 at 07:06 PM.
    Click the * Add Reputation button in the lower left hand corner of this post to say thanks.

    Don't forget to mark this thread SOLVED by going to the "Thread Tools" drop down list above your first post and choosing solved.

  8. #8
    Registered User
    Join Date
    07-13-2015
    Location
    Slovakia
    MS-Off Ver
    2007, 2010, 2013
    Posts
    76

    Re: Error 13- "type mismatch" using CountIf function

    Solved - type mismatch of the Range for the CountIf function:
    Thus is how it looks fixed:
    Please Login or Register  to view this content.

+ 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. Instr() function giving error: "Type mismatch"
    By arjun.majumdar in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-22-2013, 04:17 AM
  2. VBA Function Generating Type Mismatch Error
    By Mediterranean in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-06-2013, 11:22 AM
  3. [SOLVED] 'Type mismatch error' while translating the worksheet function to VBA
    By ramananhrm in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-30-2013, 03:02 AM
  4. Replies: 4
    Last Post: 03-27-2013, 12:16 PM
  5. Date array function has type mismatch error...
    By secret2 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-21-2011, 02:07 PM
  6. Conditional Formatting - Run Time Error '13' Type Mismatch Error
    By ksp in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-17-2011, 07:37 PM
  7. Range and Find function error: Type Mismatch
    By VBNewb in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-07-2011, 02:10 PM
  8. [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