Runtime Error Type 13 Mismatch

G

Guest

Hi - A client of mine is getting the "Runtime Error Type 13 Mismatch" error
when they execute a macro on a spreadsheet I created. Any idea on why this
was created and how I might be able to correct this issue?

Thanks,

Robert
 
B

Bob Phillips

Not without seeing the code.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Linking to specific cells in pivot table"
 
C

Chip Pearson

A type mismatch occurs when you try to assign incompatible data
to a variable. For example

Dim L As Long
L = "a"

will cause a type mismatch error because a numerical data type (L
As Long) cannot hold string data ("a").

It is impossible to diagnose your problem without seeing the
code. When the error occurs, have the client click the Debug
button (assuming the VBA Project is not protected), rather than
the End button. This will cause VBA to display the offending line
of code.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Linking to specific cells in pivot table"
<[email protected]>
wrote in message
news:[email protected]...
 
J

Jeff Standen

I think that's actually "Runtime Error 13: Type Mismatch" - it means you are
trying to use a variable of a particular type (eg integer) in something that
is expecting a different type (eg string). It should break on the line where
the error is assuming the project isn't protected so you should be able to
pick out what's causing the problem.

Jeff

"Linking to specific cells in pivot table"
 
A

aidan.heritage

Almost impossible to answer - if we could see the code it might help,
but (for example) are they expected to input a date in a particular
cell referenced by the macro, or numeric values - in either case, has
data validation been used on these cells because if not, sure as eggs
are eggs, they'll enter dates with full stops when that isn't a valid
seperator, or type the value as a text string - and the macro will then
give a type mismatch.
 
T

Tom Ogilvy

You have several good explanations of what a type mismatch error is.

Here is a guess:

Is the client using xl97?

in Excel 97, if the activecell (as an example) contains a text value and you
do

if activecell.Value = 3 then

you will get a type mismatch error.

It is much more sensative to this situation than later versions.

--
Regards,
Tom Ogilvy



"Linking to specific cells in pivot table"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top