Microsoft Office Tutorials and References
In Depth Information
Some Useful Worksheet Functions
The GetValue function doesn’t work if used in a worksheet formula. Actually, there is
no need to use this function in a formula. You can simply create a link formula to
retrieve a value from a closed file.
This example is available on the companion CD-ROM. The file is named value from a
closed workbook.xlsm . The example uses a file named myworkbook.xlsx for the
closed file.
Some Useful Worksheet Functions
The examples in this section are custom functions that you can use in worksheet formulas.
Remember, you must define these Function procedures in a VBA module (not a code module
associated with ThisWorkbook , a Sheet , or a UserForm ).
The examples in this section are available on the companion CD-ROM in a file named
worksheet functions.xlsm .
Returning cell formatting information
This section contains a number of custom functions that return information about a cell’s
formatting. These functions are useful if you need to sort data based on formatting (for example, sort in
such a way that all bold cells are together).
You’ll find that these functions aren’t always updated automatically. This is because
changing formatting, for example, doesn’t trigger Excel’s recalculation engine. To force
a global recalculation (and update all the custom functions), press Ctrl+Alt+F9.
Alternatively, you can add the following statement to your function:
When this statement is present, then pressing F9 will recalculate the function.
The following function returns TRUE if its single-cell argument has bold formatting. If a range is
passed as the argument, the function uses the upper-left cell of the range.
Function IsBold(cell) As Boolean
‘ Returns TRUE if cell is bold
IsBold = cell.Range(“A1”).Font.Bold
End Function
Search JabSto ::

Custom Search