|  

» Adding a Custom Function That Returns the Quarter Number

To add a custom function to a Module in the Personal Macro Workbook (To learn more about creating a Personal Macro Workbook.

1. Press Alt+F11 to open the VBE.
2. Double-click a Module name in the Personal Macro Workbook, or insert a new Module into the Personal Macro Workbook by selecting Module from the Insert menu.
3. Enter the following code lines into the Module:

Function QuarterNum(Enter_Date)
QuarterNum = DatePart ("q", Enter_Date)
End Function


To test the Custom Function:

1. Select any empty cell and press Shift+F3 to open the Paste Function dialog box.
2. In the User Defined category, select QuarterNum, and then click OK.
3. In the Function Arguments dialog box, enter the address of a cell containing a date, and click OK.
Screenshot // Adding a Custom Function That Returns the Quarter Number
Adding a Custom Function That Returns the Quarter Number


Rate This Tip
12 34 5
Rating: 3.45     Views: 37768
No comments have been submitted.
Click here to post comment
For Registered Users
Name
Comment Title
Comments