Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 84
Default if statement with vlookup

if range(vlookup(a1,[data.xls]inventory!$K$2:$L$1000,2,0).value = "accessory"
then
application.run "macro1"
else
application.run "macro2"

i know my error is in in the equation just cant figure it out
thanks in advance
  #2   Report Post  
Posted to microsoft.public.excel.programming
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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Vlookup, if statement, maybe an and statement Jennifer Excel Discussion (Misc queries) 1 February 26th 10 03:30 AM
Vlookup with if statement Trishames Excel Discussion (Misc queries) 1 December 1st 06 03:54 AM
Vlookup with if statement Dave F Excel Discussion (Misc queries) 0 November 30th 06 05:56 PM
If statement with Vlookup Marty Excel Worksheet Functions 1 March 30th 06 04:15 PM
Vlookup or If statement Help JPriest Excel Worksheet Functions 7 June 28th 05 08:00 PM


All times are GMT +1. The time now is 05:18 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"