Forum Discussion
anupambit1797
Apr 07, 2025Iron Contributor
How to create Custom-Functions within our Custom Addins?
Dear Experts, For example,I create an Addin like below "Anupam_Tools" ., now I want to add Custom-formulae which I use often, then how to create them within this tab. Can you plea...
Kidd_Ip
Apr 07, 2025MVP
May consider this:
1. Create a VBA Add-In:
-
- Open Excel and press Alt + F11 to open the VBA Editor.
- Go to Insert > Module to create a new module.
- Write your custom function in VBA:
Function MultiplyByTwo(num As Double) As Double
MultiplyByTwo = num * 2
End Function
-
- Save your file as an Add-in:
- Go to File > Save As.
- Choose Excel Add-In (*.xlam) as the file type.
- Save your file as an Add-in:
2. Install the Add-In:
-
- Go back to Excel.
- Open File > Options > Add-Ins.
- At the bottom, select Excel Add-ins and click Go.
- Click Browse and select your saved .xlam file.
- Once added, your custom functions will be available for use in any workbook by typing =MultiplyByTwo().
3. Create a Ribbon Tab for Custom Functions:
-
-
- Use the Office Ribbon Editor (a free third-party tool) or build the Ribbon XML yourself using VBA or .NET.
- Customize your ribbon to include a tab (e.g., "Anupam_Tools") and assign buttons to your custom functions.
-