View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Don Guillett[_4_] Don Guillett[_4_] is offline
external usenet poster
 
Posts: 2,337
Default if statement with vlookup

Without testing, try (the 1st two lines here are ONE line)

if application.vlookup(range("a1"),workbook("data.xls "). _
sheets("inventory").range($K$2:$L$1000),2,0) = "accessory" then
macro1
else
macro2
end if

Many usually define a name and then just
if vlookup([a1],definednamerange,etc

--
Don Guillett
SalesAid Software

"choice" wrote in message
...

i know my error is in in the equation just cant figure it out
thanks in advance