Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
dim res as variant
dim myVal as variant res = application.match(cboProductSelect.Value, _ worksheets("sheet1").range("a1:a999"), 0) if iserror(res) then msgbox "No match found" else myval = worksheets("sheet1").range("b1:b999")(res) end if I wasn't sure what range1 and range2 were. JurgenBrea wrote: I would like to use a worksheet function in a macro. This is how I would do it if I were entering it straight into a cell: =INDEX(range1,MATCH(F1,range2,0)) Can anyone tell me how I would enter it into the macro? The F1 would change to "cboProductSelect.Value", but other than that it should be simple, right? *hopeful* I found this reference, but haven't managed to get it working by trying to follow the guidelines as my formula has too many differences: http://msdn.microsoft.com/library/de...HV05205786.asp -- Dave Peterson |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
INDEX and MATCH functions | Excel Worksheet Functions | |||
Index and Match functions I think | New Users to Excel | |||
Using Index & Match functions to find data on separate worksheet. | Excel Worksheet Functions | |||
How do I use the Match and Index functions to look up a value tha. | Excel Worksheet Functions | |||
Using Index and Match functions to lookup data in another worksheet | Excel Programming |