addin VBA Function

jamiguel77

Active Member
Joined
Feb 14, 2006
Messages
378
Office Version
  1. 2016
  2. 2010
  3. 2007
Platform
  1. Windows
  2. Web
hi friend i have this function:

Function calcularMeses(date1 As Date, date2 As Date) As Integer
On Error Resume Next
Application.Volatile True
Dim xMEses As Integer
xMEses = 0

If Dia(date2) >= Dia(date1) Then
xMEes = (año(date2) - año(date1)) * 12 + mes(date2) - mes(date1)
End If
calcularMeses = xMEses
End Function


i do this steps:

Copy the above vba code
Open a new excel file
Right click on any sheet tab name and select “view code” option.
Don’t be scared of the VBA editor. Take a deep breath.
Click on “Insert” menu option and select “Module”
Paste the code in the new module
Press ctrl+s to save the work book. Specify “excel add-in” as the file type. i saved as: calcularMeses.xlam
Now, go back to excel and install this new add-in
That is all. Now you can use calcularMeses formula in your workbooks.


installed, closed excel, opened again, check if calcularMeses.xlam is installed but never of never i see the function..... =calcu (not autocomplete or suggest me)


any advice?

thanks
 
Last edited:

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Well first, don't put it in the sheet code module. Second if this is the only function you need to use, you don't need an add-in...you can put it in the personal macro workbook, or put it in the workbook you need it in...but put it into a regular code module. Alt+F11, Insert-Module. Paste it there.
 
Upvote 0

Forum statistics

Threads
1,214,539
Messages
6,120,100
Members
448,944
Latest member
SarahSomethingExcel100

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top