Hi All
been a member for a while now, always been able to work problems out but cannot get this one to work. Please help.
I am setting up a check list for spares. From my form i have check the number is available button. on pressing the button it runs the code. i have a sheet called 'spares' and column 'A' is the part number i am trying to look up. When i run to code its asked me for the part number to check and the ends and give an error '1004' unable to get vlookup property of worksheet function class. can anyone help.
Private sub Check_click()
Dim part number as range
Dim number as variant
Dim partnumber as variant
Sheets("spares").activate
set part number = sheets("spares").Range("a1:a135")
partnum=inputbox("enter number to check ")
Number=worksheetfunction.vlookup(partnum,partnumber,1,false)
msgbox partnum & "is available " & number
end sub
been a member for a while now, always been able to work problems out but cannot get this one to work. Please help.
I am setting up a check list for spares. From my form i have check the number is available button. on pressing the button it runs the code. i have a sheet called 'spares' and column 'A' is the part number i am trying to look up. When i run to code its asked me for the part number to check and the ends and give an error '1004' unable to get vlookup property of worksheet function class. can anyone help.
Private sub Check_click()
Dim part number as range
Dim number as variant
Dim partnumber as variant
Sheets("spares").activate
set part number = sheets("spares").Range("a1:a135")
partnum=inputbox("enter number to check ")
Number=worksheetfunction.vlookup(partnum,partnumber,1,false)
msgbox partnum & "is available " & number
end sub