Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Anita Morales   on Aug 23 In MS Office Category.

  
Question Answered By: Sherrie Thomas   on Aug 23

I think VLookup will work fine.

Let us assume that the product  table is a named range  called "tblProductList"
on a worksheet called "Products"

then use:

HighPrice = WorksheeetFunction.VLookup(ActiveWorksheet.range("B" &
Target.Row), Worksheets("Products").Range("tblProductlist"), 4, false)

LowPrice = WorksheeetFunction.VLookup(ActiveWorksheet.range("B" & Target.Row),
Worksheets("Products").Range("tblProductlist"), 3, false)

If Target.Value>LowPrice and Target.Value<HighPrice Then

'Do something with it

End If

(The long lines will undoubtedly get wrapped and you will need to unwrap them.
I have left balnk line between each line of code.)

Share: 

 

This Question has 3 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Help with simple ByVal procedure Or get search suggestion and latest updates.


Tagged: