Solved

Type MisMatch

Posted on 2010-11-18
10
648 Views
Last Modified: 2012-06-21
All of a sudden I am getting a Type Mismatch  error on the following first section of code and can not figure out why? The code has been running fine for the last week????
Can you suggest something?

Sub SenClient()
    If Application.Evaluate("=MATCH(LEFT(B15,12),LEFT(FIIS,12),0)") Then 
MsgBox "Careful Sensitive Client", vbOKOnly, "Sensitive Client"
End Sub

Open in new window

0
Comment
Question by:llawrenceg
  • 3
  • 2
  • 2
  • +2
10 Comments
 
LVL 19

Expert Comment

by:Ken Butters
ID: 34165203
you have to check the data contained in both B15, and in FIIS.  you might be comparing a text string against a number.... or against "N/A" or something.  If you are comparing against a number... you could add something like ("=MATCH(LEFT(cstr(B15),12),LEFT(cstr(FIIS),12),0)").... to make sure you only have strings.
0
 

Author Comment

by:llawrenceg
ID: 34166179
Buttersk:
Thank you for the advice. I rechecked  B15 and reformatted it as Test and I checked FIIS ( A named Range for AI2-AI31) which was already text. However, I still get the Mismatch error.
What else can I do ?
0
 
LVL 7

Expert Comment

by:Brad Sims
ID: 34166836
I would imagine from your few lines of code that due to the nature of this workbook it is not something you can post on here, am I correct?  That would be helpful to see, but I understand if it cannot be uploaded.
0
Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 
LVL 6

Expert Comment

by:sijpie
ID: 34167145
What do you get when you put the formula in a cell? Does it compute then or do you get an error code (#NAME or something)? The rrror code will give some further idea of where the error lies.
Let us know.
0
 
LVL 19

Expert Comment

by:Ken Butters
ID: 34168225
At a minimum, we need to see the data from b15 and the data from each of the cells in fiis
0
 

Author Comment

by:llawrenceg
ID: 34170161
The Data is B15 is a string copied from the Windows Clipboard "Plan # 23456"
FIIS  is a named range for a list. The list consists of Plans . Plan # 23345, Plan # 4567, Plan # 5678, Plan # 7896, all strings
0
 
LVL 6

Expert Comment

by:sijpie
ID: 34170913
Repeat from my earlier question: What do you get when you put the formula in a cell?
0
 
LVL 7

Assisted Solution

by:Brad Sims
Brad Sims earned 200 total points
ID: 34171810
If you use this in a cell it only works if entered as an array formula.  Can you try adding the ".FormulaArray" to your code?

0
 
LVL 33

Accepted Solution

by:
Norie earned 300 total points
ID: 34177377
Why not try using Application.WorksheetFunction.Match instead of Evaluate?

Or perhaps even some native VBA functions?

You might also want to look at using COUNTIF which can use wildcard characters.

=COUNTIF(LIIS, LEFT(B15,12)&"*")

That formula would return 0 for no match and 1+ if there is a match(s).
0
 

Author Closing Comment

by:llawrenceg
ID: 34220600
Thank you for your comments and advice
0

Featured Post

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Having trouble getting your hands on Dynamics 365 Field Service or Project Service trial? Worry No More!!!
The viewer will learn how to  create a slide that will launch other presentations in Microsoft PowerPoint. In the finished slide, each item launches a new PowerPoint presentation and when each is finished it automatically comes back to this slide: …
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

815 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now