Run-time error '13': Type mismatch

John Davis

Well-known Member
Joined
Sep 11, 2007
Messages
3,457
Hello All:

I'm getting the title error in the following code. Range("W" & i).Value...... line is highlighted:

Dim i As Integer
For i = 2 To 10000
If Range("V" & i).Value = "3701.30.0000" Then
Range("K" & i).Formula = _
"=VLOOKUP(L & i,'[CONVERSION FACTORS PLATES.xls]import'!$A$2:$B$10000,2,FALSE)"
Range("W" & i).Value = Range("K" & i).Value * Range("R" & i).Value
End If
Next i


Can anyone offer any help??
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
The formula in Ki is returning a error, which can't be muliplied.
When I put that formula in K1, the formula was
=VLOOKUP(L & i,'[CONVERSION FACTORS PLATES.xls]import'!$A$2:$B$10000,2,FALSE)

unless L is a named formula, L & i won't be found in the lookup range.
 
Upvote 0
Per Mike's comment:
Code:
Dim i As Long
For i = 2 To 10000
If Range("V" & i).Value = "3701.30.0000" Then
Range("K" & i).Formula = _
"=VLOOKUP(L" & i & ",'[CONVERSION FACTORS PLATES.xls]import'!$A$2:$B$10000,2,FALSE)"
Range("W" & i).Value = Range("K" & i).Value * Range("R" & i).Value
End If
Next i
 
Upvote 0
Per Mike's comment:
Code:
Dim i As Long
For i = 2 To 10000
If Range("V" & i).Value = "3701.30.0000" Then
Range("K" & i).Formula = _
"=VLOOKUP(L" & i & ",'[CONVERSION FACTORS PLATES.xls]import'!$A$2:$B$10000,2,FALSE)"
Range("W" & i).Value = Range("K" & i).Value * Range("R" & i).Value
End If
Next i

Thanks, Rory. I was still in the process of trying to solve this one. Your suggestion works.
 
Upvote 0

Forum statistics

Threads
1,214,952
Messages
6,122,457
Members
449,083
Latest member
Ava19

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