Object Required Error

manthony

New Member
Joined
Dec 5, 2016
Messages
40
Hi, I am getting an Run-time err 424 Object Required error on the line of code below.

If CustomerComboBox = Application.VLookup(CustomerComboBox, InvoiceInfo.Range("NonautomatedContracts"), 1, False) Then
MsgBox "Please fix."
Exit Sub
End If

This is taking place in a Userform. The CustomerComboBox is a value from a combobox and it is comparing what is in the customercombobox against a list titled Nonautomated Contracts.

Any ideas?

Thanks - M
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
perhaps this? but you also want to consider the fact that Application.Vlookup, if not match found, it won't return N/A, it will return a run time error. Test for Range("NonautomatedContracts").Find(.......) Is Nothing, instead.

Code:
If CustomerComboBox[B].value[/B] = Application.VLookup(CustomerComboBox[B].value[/B], InvoiceInfo.Range("NonautomatedContracts"), 1, False) Then
           MsgBox "Please fix."
           Exit Sub
    End If
 
Upvote 0
Is 'InvoiceInfo' the codename or the tab name of the worksheet?

If it's the latter you'll need to use Sheets("InvoiceInfo").
 
Upvote 0

Forum statistics

Threads
1,214,525
Messages
6,120,051
Members
448,940
Latest member
mdusw

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