CALLER macro

Returns information about the cell, range of cells, command on a menu, tool on a toolbar, or object that called the macro that is currently running. Use CALLER in a subroutine or custom function whose behavior depends on the location, size, name, or other attribute of the caller.

Syntax

CALLER( )

Remarks

 

Examples

If the custom function MACROS!VALUEONE is entered in cell B3 on a sheet named SALES, the nested CALLER function returns the following values.

Nested function Returns
COLUMN(CALLER()) 2
COLUMNS(CALLER()) 1
GET.CELL(1, CALLER()) SALES!$B$3
ROW(CALLER()) 3
ROWS(CALLER()) 1

If the same custom function was entered into an array in cells B2:C3, the following values would be returned.

Nested function Returns
COLUMN(CALLER()) 2
COLUMNS(CALLER()) 2
ROW(CALLER()) 2
ROWS(CALLER()) 2

Related Functions

GET.BAR   Returns the name or position number of menu bars, menus, and commands

GET.CELL   Returns information about the specified cell

Return to index