+ Reply to Thread
Results 1 to 7 of 7

VBA mismatch

  1. #1
    Registered User
    Join Date
    08-31-2012
    Location
    Metro Detroit
    MS-Off Ver
    Excel 2007
    Posts
    18

    VBA mismatch

    I am new to VBA programming and I am trying to create a file that measures the distance between two holes and and makes sure there is at least one hole diameter in between them. I keep getting a mismatch however. The file is attached. I would appreciate any suggestions you might have.
    Attached Files Attached Files

  2. #2
    Forum Expert OllieB's Avatar
    Join Date
    12-20-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2007 (home) & 2010 (office)
    Posts
    1,542

    Re: VBA mismatch

    The function Largest_Diameter expects both parameters to be of a type DOUBLE. When debugging I noticed that Cells(a, 23) en Cells(b, 23) contain the value "Y" as opposed to a numeric value.

  3. #3
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: VBA mismatch

    You're passing the contents of cell W8 to the function Largest_Diameter, where's it's expecting a number, but the contents of that cell are actually "Y"

  4. #4
    Registered User
    Join Date
    08-31-2012
    Location
    Metro Detroit
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: VBA mismatch

    Okay, so I don't want to pass the contents of any cell to another. I just want to check that the hypotenuse is greater than one hole diameter. If it is less, part of the row should be highlighted. Where did I go wrong?

  5. #5
    Registered User
    Join Date
    08-31-2012
    Location
    Metro Detroit
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: VBA mismatch

    I've tried several different data types and still get a mismatch. Which should I be using?

  6. #6
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: VBA mismatch

    Well changing the line:

    Please Login or Register  to view this content.
    To:

    Please Login or Register  to view this content.
    Will fix this problem and move you onto your next one.

  7. #7
    Registered User
    Join Date
    08-31-2012
    Location
    Metro Detroit
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: VBA mismatch

    Oh my gosh. It's always something super simple like that isn't it. I forgot I had a hidden column. Thank you so much!

+ Reply to 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