Solved

Type MisMatch

Posted on 2010-11-18
10
669 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
Veeam gives away 10 full conference passes

Veeam is a VMworld 2017 US & Europe Platinum Sponsor. Enter the raffle to get the full conference pass. Pass includes the admission to all general and breakout sessions, VMware Hands-On Labs, Solutions Exchange, exclusive giveaways and the great VMworld Customer Appreciation Part

 
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 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 34

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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

This article describes a serious pitfall that can happen when deleting shapes using VBA.
This article helps those who get the 0xc004d307 error when trying to rearm (reset the license) Office 2013 in a Virtual Desktop Infrastructure (VDI) and/or those trying to prep the master image for Microsoft Key Management (KMS) activation. (i.e.- C…
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

617 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