Thread: type mismatch
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] ExcelQuestion123@gmail.com is offline
external usenet poster
 
Posts: 7
Default type mismatch

I'm having an issues with this simple code and can't figure it out. I
always get the type mismatch error. I do have a range named
StatusTable, so that's not the problem. Please help.

Sub msg()
Dim i, j, k As Integer
i = 1
j = 3

If Application.VLookup(Worksheets(i).Range("A" & j) &
Worksheets(i).Range("D" & j), Range("StatusTable"), 2, False) = "Paid"
Then
MsgBox ("Correct")
Else: MsgBox ("Error")
End If

End Sub