Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
function doesn't work
Hi! Can anyone spot what is wrong with the following
function. I'm trying to write a function similar to vlookup, but which allows for more flexibility. I could swear it was working to a degree with excelXP ("find" only picked up one element - I thought the output would be a set of elements), but now with excel97 it doesn't work at all. Function lookupvalue(valuetolookup, lookuprange, rowoffset, columnoffset) Set rangeofvalues = lookuprange.Find(valuetolookup) For Each element In rangeofvalues MsgBox (element.Address) Next element 'Set nextvalue = lookuprange.FindNext 'If nextvalue Is Nothing Then lookupvalue = lookuprange.Find(valuetolookup).Offset (rowoffset, columnoffset).Value 'Else: MsgBox ("multiple output") 'End If End Function |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
function doesn't work
Find doesn't work with UDF's in Excel 97 and Excel 2000.
-- Regards, Tom Ogilvy "Claude" wrote in message ... Hi! Can anyone spot what is wrong with the following function. I'm trying to write a function similar to vlookup, but which allows for more flexibility. I could swear it was working to a degree with excelXP ("find" only picked up one element - I thought the output would be a set of elements), but now with excel97 it doesn't work at all. Function lookupvalue(valuetolookup, lookuprange, rowoffset, columnoffset) Set rangeofvalues = lookuprange.Find(valuetolookup) For Each element In rangeofvalues MsgBox (element.Address) Next element 'Set nextvalue = lookuprange.FindNext 'If nextvalue Is Nothing Then lookupvalue = lookuprange.Find(valuetolookup).Offset (rowoffset, columnoffset).Value 'Else: MsgBox ("multiple output") 'End If End Function |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Why won't this function work? | Excel Worksheet Functions | |||
Function doesn't work | Excel Worksheet Functions | |||
need a function that will work using multiple work books and sheet | Excel Worksheet Functions | |||
Why does my Function not work? | Excel Discussion (Misc queries) | |||
how do i get the mid function to work with a zero | Excel Worksheet Functions |