+ Reply to Thread
Results 1 to 2 of 2

If Error on 'Type Mismatch'

  1. #1
    Registered User
    Join Date
    10-26-2013
    Location
    New York
    MS-Off Ver
    Excel 2007
    Posts
    11

    If Error on 'Type Mismatch'

    I am running a VBA userform that takes data input by the user and outputs a calculated value. If the user does not put in all of the required data, the calculation cannot be perfomed, and excel will return #Value instead of an actual calculated value. When my VBA userform wants to recall this calculated value to display on the userform, I get an error:

    Run-time error ‘-2147352571 (80020005)’:

    Could not set the Value property. Type Mismatch.

    I understand why this error occurs. My vba userform is trying to pull in a value from a spreadsheet and instead it gets #Value. These types do not match. What I would like to do is if this error occurs, a pop up would occur on my userform stating "Please enter all required information." How would I execute this If Error statement? Also, these values I am displaying are called RefundFee and ProcessingFee. Thank you for your help, I do not have much experience with If Error statements.

    Below is my Userform Code:

    Please Login or Register  to view this content.

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

    Re: If Error on 'Type Mismatch'

    You can use IsError to check if the cell contains an error, if it does then display your message, if it doesn't put the value in the textbox.

    For example, for RefundFee.
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

+ 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 Type error 13 Type Mismatch
    By Affan Khan in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 11-13-2012, 12:58 PM
  2. [SOLVED] Run-type error 13 type mismatch
    By misop in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-05-2012, 04:08 AM
  3. Complile Error: Type Mismatch ??? After adding error trap
    By clemsoncooz in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-22-2012, 03:50 PM
  4. 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
  5. [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