jamiguel77
Active Member
- Joined
- Feb 14, 2006
- Messages
- 378
- Office Version
- 2016
- 2010
- 2007
- Platform
- Windows
- 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
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: