Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Type MisMatch

Posted on 2010-11-18
10
Medium Priority
?
682 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, 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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 35

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

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

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

After seeing numerous questions for Dynamic Data Validation I notice that most have used Visual Basic to solve the problem. This suggestion is purely formula based and can be used in multiple rows.
Windows Explorer lets you open cabinet (cab) files like any other folder. In VBA you can easily handle normal files and folders, but opening and indeed creating cabinet files takes a lot more - and that's you'll find here.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

927 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