ACTIVE.CELL

Macro Sheets Only

Returns the reference of the active cell in the selection as an external reference.

Syntax

ACTIVE.CELL( )

Remarks

Tip Use the following macro formula to verify that the current selection is a cell or range of cells:


=ISREF(ACTIVE.CELL( ))

Examples

The following macro formula assigns the name Sales to the active cell:


SET.NAME("Sales", ACTIVE.CELL())

In this example, note that "Sales" refers to a cell on the active worksheet, but the name itself exists only in the macro sheet's list of names. In other words, the preceding formula does not define a name on the worksheet.

The following macro formula puts the reference of the active cell into the cell named Temp:


FORMULA("="&REFTEXT(ACTIVE.CELL()), Temp)

The following macro formula checks the contents of the active cell. If the cell contains only the letter "c" or "s", the macro branches to an area named FinishRefresh:


IF(OR(ACTIVE.CELL()="c", ACTIVE.CELL()="s"), GOTO(FinishRefresh))

In Microsoft Excel for Windows, if the document in the active window is named SALES and A1 is the active cell, then:

ACTIVE.CELL() equals SALES!$A$1

In Microsoft Excel for the Macintosh, if the document in the active window is named SALES 1 and A1 is the active cell, then:

ACTIVE.CELL() equals 'SALES 1'!$A$1

Related Functions

SELECT Selects a cell, worksheet object, or chart item

List of Information Functions