Hi all,
I am trying to use this user defined function called RANGEMATCH that i had a look at being used elsewhere being the following code
Function RANGEMATCH(SearchIn As Range, SearchFor As Range)
'
'
For Each Cell In SearchFor
If InStr(SearchIn, Cell) Then
RANGEMATCH = Cell.Value
Else
RANGEMATCH = ""
End If
Next Cell
End Function
[FONT=Helvetica Neue, Helvetica, Arial, san-serif]Then I am calling up the function and directing it to search my description cell (SearchIn) and then pointing it to my named data range (SearchFor) but it doesn't quite work. It does work if the last item say the 5th item out of a list of 5 in my search list is found but if it is the 1st, 2nd, 3rd or 4th in the list of 5 then this [/FONT][FONT=Helvetica Neue, Helvetica, Arial, san-serif]doesn't[/FONT][FONT=Helvetica Neue, Helvetica, Arial, san-serif] seem to work at all?????? [/FONT]
[FONT=Helvetica Neue, Helvetica, Arial, san-serif]I know i am probably missing something very simple but this is driving me nuts!!! [/FONT]
[FONT=Helvetica Neue, Helvetica, Arial, san-serif]Any ideas please???[/FONT]
I am trying to use this user defined function called RANGEMATCH that i had a look at being used elsewhere being the following code
Function RANGEMATCH(SearchIn As Range, SearchFor As Range)
'
'
For Each Cell In SearchFor
If InStr(SearchIn, Cell) Then
RANGEMATCH = Cell.Value
Else
RANGEMATCH = ""
End If
Next Cell
End Function
[FONT=Helvetica Neue, Helvetica, Arial, san-serif]Then I am calling up the function and directing it to search my description cell (SearchIn) and then pointing it to my named data range (SearchFor) but it doesn't quite work. It does work if the last item say the 5th item out of a list of 5 in my search list is found but if it is the 1st, 2nd, 3rd or 4th in the list of 5 then this [/FONT][FONT=Helvetica Neue, Helvetica, Arial, san-serif]doesn't[/FONT][FONT=Helvetica Neue, Helvetica, Arial, san-serif] seem to work at all?????? [/FONT]
[FONT=Helvetica Neue, Helvetica, Arial, san-serif]I know i am probably missing something very simple but this is driving me nuts!!! [/FONT]
[FONT=Helvetica Neue, Helvetica, Arial, san-serif]Any ideas please???[/FONT]