Run-time error: '13' Type mismatch

Roller

Board Regular
Joined
Jan 31, 2005
Messages
113
I have a basic data input sheet which users populate columns B through W with data. In hidden columns X through AS, I have a formula that returns "true" or "false" that checks the data values in each of the corresponding columns based on individual data requirements. In Column AT, I have a simple =AND( ) formula that returns a 1 if there are any false values in X through AS. I also have a formula in a named range that is used in a macro for this sheet (see below). The macro below is designed to only show the button when all the data fields meets the requirements. The button creates an XML file written to the users local drive (this part works fine).

My problem is: some users are getting the run-time error '13': type mismatch when inputting data. Others (including myself), do not. The data is simple address and payment information (like from a check register: Name, address, amount, reason for check payment, etc.). Any reason that would cause some people to get this error while others do not? Users can input data or copy/paste data.

Formula: =IF(SUM(CheckDataInput!AT:AT)=0,TRUE,FALSE)
Macro:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Selection.Count = 1 Then
Select Case Target.Address
Case Range("ShowMacroButton").Address
If Range("ShowMacroButton").Value = True Then
Sheets("CheckDataInput").Shapes("Button 1").Visible = True
Else
Sheets("CheckDataInput").Shapes("Button 1").Visible = False
End If
End Select
End If
End Sub

Thank you, in advance, for your consideration in helping resolve this.
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
We've instructed users to "paste values". Also, there is 1 date field and 1 postal code field. The feedback says this error occurs after inputting the postal code. The date field is the 3rd field whereas the postal code is the 13th field to enter assuming they are entering data left to right in order.
 
Upvote 0
Assuming your named range contains this formula
=IF(SUM(CheckDataInput!AT:AT)=0,TRUE,FALSE)

Check that the users who are getting problems don't have an error value in that cell.
 
Upvote 0
So far, the only errors that I have been able to create to replicate the error is if someone is trying to copy an unknown cell reference (i.e. #REF!), but numerical errors or errors that don't meet the requirements (i.e. character length) just return False in their corresponding columns as it should (and would give me a sum result > 0). I'll keep digging but still trying to get more examples. Thanks!
 
Upvote 0
If you have any error values in col AT, then this formula
=IF(SUM(CheckDataInput!AT:AT)=0,TRUE,FALSE)

will return that error value, which in turn will give you a type mismatch error in your code.
Which line of code is highlighted when the error occurs?
 
Upvote 0
This is the line of code highlighted on the error:
If Range("ShowMacroButton").Value = True Then
 
Upvote 0
Is the named range range a single cell?
If so, then it almost certainly contains an error.
 
Upvote 0
Yes, it is. I'll look for an error in their worksheet (once they send me a copy) but it seems odd that in a postal code field where I am only checking for the number of characters in the cell it would cause an error. Thank you.
 
Upvote 0
Ok, for reference you can simplify your formula to
=SUM(CheckDataInput!AT:AT)=0
No need for the IF function
 
Upvote 0

Forum statistics

Threads
1,223,238
Messages
6,170,939
Members
452,368
Latest member
jayp2104

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top