Академический Документы
Профессиональный Документы
Культура Документы
For an excellent explanation of pretty much everything you need to know to create your own custom
Excel function, I would recommend John Walkenbach's book, Excel 200X Formulas. The book
provides many good user defined function examples, so if you like to learn by example, it is a great
resource.
This article will help you get started with user defined functions and show a couple of cool examples.
6. Use the functions (They will appear in the Paste Function dialog box, Shift+F3, under the "User
Defined" category)
If you want to use a UDF in more than one workbook, you can save your functions in your own custom
add-in. Simply save your excel file that contains your VBA functions as an add-in file (.xla). Then load
the add-in (Tools > Add-Ins...). Warning! Be careful about using custom functions in spreadsheets that
you need to share with others. If they don't have your add-in, the functions will not work when they use
the spreadsheet.
Benefits of User Defined Excel Functions
• Create a complex or custom math function.
• Simplify formulas that would otherwise be extremely long "mega formulas".
• Diagnostics such as checking cell formats.
• Custom text manipulation.
• Advanced array formulas and matrix functions.
Limitations of UDF's
• Cannot "record" an Excel UDF like you can an Excel macro.
• More limited than regular VBA macros. UDF's cannot alter the structure or format of a
worksheet or cell.
• If you call another function or macro from a UDF, the other macro is under the same limitations
as the UDF.
• Cannot place a value in a cell other than the cell (or range) containing the formula. In other
words, UDF's are meant to be used as "formulas", not necessarily "macros".
• Excel user defined functions in VBA are usually much slower than functions compiled in C++
or FORTRAN.
• Often difficult to track errors.
• If you create an add-in containing your UDF's, you may forget that you have used a custom
function, making the file less sharable.
• Adding user defined functions to your workbook will trigger the "macro" flag (a security
issue: Tools > Macros > Security...).
Vertex42 Articles
» Dashboard Reports
» Using Excel Solver
» Excel Web Queries
» Custom Excel Functions
» Sparklines
» Excel Shortcuts
» Excel Games
» Invoicing with Excel
Finance
» Amortization Formulas
» Financial Modeling
» Amortization Calculation
» Simple Interest
» Negative Amortization
» Debt Consolidation
» How to Make a Budget
» Budgeting Tips
» Exponential Growth
» Discount Factor
» Resources for Homeowners
Statistics
» Monte Carlo Simulation
» Histograms in Excel
» Random Numbers
» Normal Distribution Graph
» Pareto Chart Analysis
» Dot Plot
» Control Charts
Excel Tips
» Array Formula Examples
» Drop Down List via Data Validation
» Dynamic Named Ranges
» Significant Figures
» Excel's COUNTIF Function
» Toolbar Buttons
» Grouping and Outlining
» Free Excel Training
Excel Templates
»Amortization Schedule
»Asset Tracking
»Attendance Tracking
»Auto Loan
»Balloon Loan
»Budget Worksheet
»Calendar Template
»Check Register
»Class Schedule
»Debt Reduction
»Depreciation
»Expense Reports
»Fax Cover Sheet
»Gantt Chart
»Home Budget
»Home Equity Loan
»Home Mortgage Calculator
»Home Inventory
»Invoice
»Mileage Log
»Money Manager
»Mortgage
»NPV
»Organizational Chart
»Personal Budget
»Project Template
»Purchase Order
»Retirement Savings
»Savings Calculator
»Shift Schedule
»Stock Quotes
»Timesheet
»Timecard
»Timeline Examples
»Wedding Budget
»Weight Loss Chart
»Work Order
»Work Schedule
»Yearly Calendar
»2011 Calendar
»Calendario 2011
»Calendrier 2010
Word Templates
»Resume Template
»Bill of Sale Form
»Business Card Template
»Recipe Card Template
»Gift Certificate Template
Home | Sitemap | Excel Links | About/Contact Us | Privacy | Legal Stuff
Microsoft® and Microsoft Excel® and Microsoft Word® are registered trademarks of Microsoft
Corporation. Vertex42.com is not associated with Microsoft.
© 2003-2010 Vertex42 LLC. All rights reserved.
Custom Excel Functions