Return to VBA Code Examples

VBA Range / Cell Address

This tutorial will demonstrate how to get a cell’s address.

Get Range Address

This will display the cell address using the Range object:

vba range cell address

Get Cells Address

This will display the cell address using the Cells object:

ActiveCell Address

To get the ActiveCell address use this code:

VBA Programming | Code Generator does work for you!

Set Variable to Cell Address

You can also assign the cell address to a string variable for easy use within your code:

 

Get Row Number From Cell Address

This code will extract the row number from an address:

However, usually you can use this much simpler code: