Active Cell?

T

tgi

is there a way to tell which cell is active.

say A1 displays the Active cell address.
i know row() and columns() returns that particular row and comumn number, so
what i need is something like ActiveRow() and ActiveColumn()

so in A1 if i write a formula
=address(ActiveRow(), ActiveColumn())
would keep displaying whatever cell you go to.

is there anything similar to this i can do?

thanks in advance.
 
K

KC

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Range("A1") = ActiveCell.Address
End Sub

-kc
*Click YES if this works
 
G

Gord Dibben

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Me.Range("A1") = ActiveCell.Address
End Sub

Right-click on the sheet tab and "View Code"

Copy/paste the above code into that sheet module.

Alt + q to return to Excel.

If you wanted this for all sheets in a workbook place this code in
Thisworkbook module.

Private Sub Workbook_SheetSelectionChange(ByVal _
Sh As Object, ByVal Target As Range)
ActiveSheet.Range("A1") = ActiveCell.Address
End Sub


Gord Dibben MS Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top