Closed Thread
Results 1 to 3 of 3

Compile Error - Type Mismatch in VBA

  1. #1
    Registered User
    Join Date
    04-13-2009
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    6

    Compile Error - Type Mismatch in VBA

    I'm attempting to check a named range to see if the contents of the cells are blank.

    I set the named range based on position of the active cell. The range I want to check is in the same column, 1 to 5 rows above the active cell. That part seems to be working. However I'm getting a type mismatch compile error and can't figure out why or how to fix it. Seems to be hanging up at the "If WorksheetFunction.CountBlank("QualRange") = 5 Then" line. Here's my code.

    Please Login or Register  to view this content.
    What am I doing wrong?


  2. #2
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Compile Error - Type Mismatch in VBA

    WorksheetFunction.CountBlank() needs a Range as its argument. That code is giving it a String. Try
    Please Login or Register  to view this content.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  3. #3
    Registered User
    Join Date
    04-13-2009
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Compile Error - Type Mismatch in VBA

    Quote Originally Posted by mikerickson View Post
    WorksheetFunction.CountBlank() needs a Range as its argument. That code is giving it a String. Try
    Please Login or Register  to view this content.
    That did the trick. Thanks very much!

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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