Forum Discussion
User Defined Function not showing with up "="
Hi Katrina,
You can save the UDFs in the https://support.office.com/en-us/article/Copy-your-macros-to-a-Personal-Macro-Workbook-AA439B90-F836-4381-97F0-6E4C3F5EE566 in order to make them available to all open workbooks.
For more info, please check out this https://trumpexcel.com/personal-macro-workbook/.
Hope that helps
OPTIONS EXPLICIT
PUBLIC FUNCTION BUYBACK (SUBCAT AS STRING, UPRICE AS SINGLE)
IF CODE YADADADADADA
END IF
END FUNCTION.
DIDN'T FEEL LIKE PUTTING THE MILE LONG CODE LOL.
- Haytham AmairahNov 15, 2018Silver Contributor
Hi Katrina,
I'm sorry about that!
I forgot that this only works in the subroutines (Subs), not in the functions!
With regards to the functions, you need to create a new workbook and save the function in a module in this workbook, then you have to save this workbook as Excel Add-in (*.xlam) file extension.
After that, you need to copy this workbook into the XLSTART folder.
To locate this folder, please follow this path:
C:\Users\<username>\AppData\Roaming\Microsoft\Excel\XLSTART
But please note that the code you attached seems to be wrong!
It's Option Explicit (Option without s).
Also, you have to remove the period (.) after the End Function!
Hope that helps
- MouthpearAug 30, 2022Copper ContributorThank you this worked for me.
- EPhi102Apr 12, 2019Copper ContributorYour Post Saved Me Today!!! I fought with a user defined function for hours, could not get it to work just kept getting the "#NAME!" error.
Then, read your post and forgot to put it in the XLSTART folder.
Thanks! - katrina betheaNov 15, 2018Brass Contributorlol there is an s and no period in my actual code, those are just typos from when i was writing it here.
btw that worked! thank you so much. sorry about the all caps had caps lock on.