Return address of active cell
To get the address of an active cell you can use a combination of Excel ADDRESS, ROW and COLUMN functions, using Excel and VBA
Example: Return address of active cell
This formula uses the Excel ROW and COLUMN functions to get the row and column numbers of an active cell, respectively. These results are used inside the Excel ADDRESS function to return the address of an active cell (in the cell where the formula is written in).
|
Sub Return_address_of_active_cell()
'return the address of an cell
ActiveCell = ActiveCell.Address
ActiveCell = ActiveCell.Address
End Sub
EXPLANATION
This tutorial shows and explains how to return the address of an active cell, by using an Excel formula or VBA.
This tutorial shows and explains how to return the address of an active cell, by using an Excel formula or VBA.
Excel Method: This tutorial provides a single Excel method that can be applied to return the address of the cell in which the formula is written in, using a combination of Excel ADDRESS, ROW and COLUMN functions.
VBA Method: This tutorial provides a single VBA method that returns the address of an active cell by referencing to the active cell and applying the Address function to it.
FORMULA
ADDRESS(ROW(),COLUMN())
ADDRESS(ROW(),COLUMN())
ADDITIONAL NOTES
Note 1: This formula will return the address of the in which it's written in.
Note 1: This formula will return the address of the in which it's written in.
RELATED TOPICS
Related Topic | Description | Related Topic and Description |
---|---|---|
Average last n values in a column | How to average the last n values in a column using Excel and VBA methods | |
Average first n values in a row | How to average the first n values in a row using Excel and VBA methods | |
Average first n values in a column | How to average the first n values in a column using Excel and VBA methods | |
Sum last n values in a row | How to sum the last n values in a row using Excel and VBA methods | |
Sum first n values in a row | How to sum the first n values in a row using Excel and VBA methods |
RELATED FUNCTIONS
Related Functions | Description | Related Functions and Description |
---|---|---|
ADDRESS Function | The Excel ADDRESS function returns a cell reference as a string, based on a row and column number | |
ROW Function | The Excel ROW function returns the first row number of the selected reference | |
COLUMN Function | The Excel COLUMN function returns the first column number of the selected reference |