excel - VBA function error when other users try to use it -


i've made short function find whether name "given name surname" or "surname, given name", when run user (on pc), result function in error #name? :

function findname_function(namecell string) string  dim findcomma long dim findname string  findcomma = instr(1, namecell, ",")  if findcomma <> 0      findname = vba.right(namecell, len(namecell) - findcomma)  else      findname = vba.left(namecell, instr(1, namecell, " ") - 1)  end if  findname_function = findname   end function 

this how function called: this how function called:

this formula:

="hello "&findname_function(index(table_hp_effective_contact_list;match(siteid;table_hp_effective_contact_list[site];0);4))&"," 

i believe use function udf (user defined function) , #name error indicates function can't found or executed. make sure store udf on discoverable location , has permission run. not clear question -where- stored udf , security settings on client machines.

what did create new workbook, added new module workbook, copied udf in module, used in cell on new workbook , worked without problems. guess limited information provided stored udf in different location outside workbook, inaccessible other users find.

on side note: - vba. prefix not needed - test if name empty, instr fail if name empty

if want better answer, please elaborate on location of udf (where did create/store udf) , macro security settings in place on machines see error on.

enter image description here

enter image description here


Comments

Popular posts from this blog

ios - UITEXTFIELD InputView Uipicker not working in swift -

Hatching array of circles in AutoCAD using c# -

Python Pig Latin Translator -