# Run-time error '13': Type mismatch

#### John Davis

##### Well-known Member
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

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college

#### mikerickson

##### MrExcel MVP
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.

#### RoryA

##### MrExcel MVP, Moderator
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``````

#### John Davis

##### Well-known Member
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.

Replies
1
Views
122
Replies
2
Views
146
Replies
2
Views
117
Replies
5
Views
147
Replies
2
Views
89

1,191,419
Messages
5,986,454
Members
440,031
Latest member
davidvillegasr

### 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.

### Which adblocker are you using?

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

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