help with if is error

kevin1970

New Member
Joined
Jun 2, 2011
Messages
11
Hi all
i have attached part of my code below. i cannot get the is iferror code to work, can anyone help please
thanks
kevin



Dim partnumber As Range
Dim number As Variant
Dim number1 As Variant
Dim number2 As Variant
Dim partnum As Variant
Dim partnum1 As Variant
Dim partnum2 As Variant


Sheets("spares").Activate
Set partnumber = Sheets("spares").Range("A1:A137")


partnum = Val(txtpart)
partnum1 = Val(txtpart1)
partnum2 = Val(txtpart2)


number = Application.vlookup(partnum, partnumber, 1, False)
number1 = Application.vlookup(partnum1, partnumber, 1, False)
number2 = Application.vlookup(partnum2, partnumber, 1, False)
If IsError(number) & (number1) & (number2) Then
MsgBox "PART NUMBER ENTERED IS INCORRECT", vbExclamation
End If
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
Perhaps

Code:
If IsError(Number) And IsError(number1) And IsError(number2) Then
 
Upvote 0

Forum statistics

Threads
1,206,971
Messages
6,075,922
Members
446,170
Latest member
zzzz02

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