Run time error 424

manthony

New Member
Joined
Dec 5, 2016
Messages
40
Hi, I am getting a run time error 424 on the code below:

If Sheets("Specs").Range("B4").Value = Application.WorksheetFunction.VLookup(Sheets("Specs").Range("B4").Value, Sheets("InvoiceInfo").Range("E1:E100"), 1, False).valu Then
MsgBox "This is a fixed item. "
Exit Sub
End If


I do not have any Dim set. I am guessing that is the problem. Cell B4 on Specs is a word and is trying to see if the same work is on sheet InvoiceInfo column E. I am unsure of what Dims I need to set. Any ideas?
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Hi manthony,

Not sure what's wrong with your code but this works:

Code:
Option Explicit
Sub Macro1()

    If Sheets("Specs").Range("B4").Value = Evaluate("VLOOKUP(Specs!B4,InvoiceInfo!E1:E100,1,FALSE)") Then
        MsgBox "This is a fixed item."
        Exit Sub
    End If
    
End Sub

Regards,

Robert
 
Upvote 0

Forum statistics

Threads
1,223,164
Messages
6,170,444
Members
452,326
Latest member
johnshaji

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