excel - How do I use a sub from a different work book -
in personal.xlsb workbook, have code:
public sub password(byval target range) = "" n = 1 len(target) = & "*" next n target.numberformat = """" & & """;""" & & """;""" & & """;""" & & """" end sub
in new workbook, have code:
private sub worksheet_change(byval target range) if target.address = info.range("aa9").address workbooks("personal.xlsb").password target end if end sub
i keep getting error saying, compile error: invalid use of property
here's how run macro personal workbook:
application.run "personal.xlsb!password", target
[edit] it's worth noting instead of loop build * string, this:
public sub password(byval target range) dim smask string smask = mid(worksheetfunction.rept(";""" & string(len(target.value), "*") & """", 4), 2) target.numberformat = smask end sub
Comments
Post a Comment