Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Type MisMatch

Posted on 2010-11-18
10
Medium Priority
?
676 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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, CCNA
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
Survive A High-Traffic Event with Percona

Your application or website rely on your database to deliver information about products and services to your customers. You can’t afford to have your database lose performance, lose availability or become unresponsive – even for just a few minutes.

 
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, CCNA
Brad Sims, CCNA earned 600 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 34

Accepted Solution

by:
Norie earned 900 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

Office 365 Training for IT Pros

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

Question has a verified solution.

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

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
I was prompted to write this article after the recent World-Wide Ransomware outbreak. For years now, System Administrators around the world have used the excuse of "Waiting a Bit" before applying Security Patch Updates. This type of reasoning to me …
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

718 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