hi
I have written a user-defined function that searches for a small range within a larger range. The function requires two input parameters: the range you are looking for, and the range you want to look within.
For example, I might look for the string of values in cells A1:D1 in a larger range E1:H20. The function returns the row number in the larger range where the smaller range is found.
My problem is this: The function is working fine when I call it from another sub procedure. However, when I try to run it as a worksheet function, I get a "#VALUE!" error. The function pops up in the "insert function" menu, and it prompts for the two input parameters. I just does not appear to run properly, and I can't figure out why, so any help on this would be great.
Here's the function. See below for an example sub procedure I used to call the function and get it to run (by hard-coding in the ranges to search for/search in).
![]()
Please Login or Register to view this content.
Sub procedure for checking the function functionality:
![]()
Please Login or Register to view this content.
Bookmarks