I was trying to produce a function which would search a specified Range for a passed value; declared like this;
My Workbook has multiple sheets and the named Ranges ActiveStaff and StaffList are not on the same sheet from where the Function will be called.
I just need to get either True or False as to whether the passed name exists on the list indicated by the pFlag switch.
If the name exists (on the pFlag List), the function returns "1" correctly (there is currently only 1 instance of each name on each list). However, if I call the function and the name is not on the list indicated I get an error which says "Object variable or with block variable not set"
I have tried better qualifying the named ranges like this;
and this;
but the results are the same.
While I would like to fix the problem I would also like to understand whats happening better as I would probably like to create my own function that allows me to pass both the search string and the range to search in the end.
Thanks for reading.
Bookmarks