functions within functions

Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

Forum home » Delegate support and help forum » Microsoft Excel Training and help » Functions within functions

Functions within functions

resolvedResolved · Low Priority · Version Standard

James has attended:
Excel Advanced course
Excel VBA Intro Intermediate course
Excel VBA Advanced course

Functions within functions

How do you call a predefined function in a User defined function?

Edited on Fri 28 Mar 2008, 09:59

RE: Functions within functions

Hi James

Thank you for your question

I am assuming that you want to use one of the standard functions within your user defined function

To do this use need to use the work sheet function property of the application object.

For example the following code calculates the average of a range of cells and then returns it to a variable called MyAverage

MyAverage = Application.WorksheetFunction.Average("B1:D15")


Hope this is useful

Regards

Stephen



 

Excel tip:

Hiding a worksheet in Excel

Want to circulate an Excel workbook file but keep certain worksheets hidden from your colleagues' view?

You can do so by bringing up the sheet you wish to hide on your screen; then going to Format - Sheet - Hide.

It will not be immediately obvious that a sheet is hidden from view unless perhaps the sheet are still labelled Sheet 1, Sheet 2 etc.

To display the sheet again, you can go to Format - Sheet - Unhide on any of the other sheets in the workbook. A dialogue box will appear, allowing you to select the hidden sheet/s. Click OK to make the sheet/s reappear again.

View all Excel hints and tips


Server loaded in 0.1 secs.