Can anyone offer any general guidelines regarding code placement (in modules vs. sheets vs. workbooks. vs. class modules)?
Is vba code stored in a sheet object limited to handling events, buttons, dropdowns, etc?
If I define a custom function in a sheet object I can see it back in Excel in the Insert Function list but it won't work, even when I include the full path.
Works fine when stored in a regular VBA module.
(FWIW - I wanted to put the function in the worksheet object so the code would go along with the worksheet when it was pulled out of a workbook. I've since learned in this forum how to export code from a module & then re-import it into the new workbook, but the other way sure would have been easier.)
Is vba code stored in a sheet object limited to handling events, buttons, dropdowns, etc?
If I define a custom function in a sheet object I can see it back in Excel in the Insert Function list but it won't work, even when I include the full path.
Works fine when stored in a regular VBA module.
(FWIW - I wanted to put the function in the worksheet object so the code would go along with the worksheet when it was pulled out of a workbook. I've since learned in this forum how to export code from a module & then re-import it into the new workbook, but the other way sure would have been easier.)