using excel formula to indicate the active cell

  • Thread starter Thread starter thread
  • Start date Start date
T

thread

Hi all,

is it posible to have a formula in excel that indicates the current
cell?
 
One could write a UDF, but it wouldn't be accurate most of the time,
since changing the active cell doesn't cause a recalculation.

A better way to indicate the active cell would be to use an event macro.
Put this in your worksheet code module:

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

Change the range to suit.
 
Hi thank you for thr quick answer but my issue is that i want to have
a formula that is not a vba code
is it posible
i want the formula inside of the cell to indicate what row is it

JE McGimpsey :
 
=CELL("address")

Press F9 to update.

Hi thank you for thr quick answer but my issue is that i want to have
a formula that is not a vba code
is it posible
i want the formula inside of the cell to indicate what row is it

JE McGimpsey :


One could write a UDF, but it wouldn't be accurate most of the time,
since changing the active cell doesn't cause a recalculation.
A better way to indicate the active cell would be to use an event macro.
Put this in your worksheet code module:
 
Hi

If you just want the Row number, as opposed to the cell address as you
posted first, then
=ROW()
 
If you can't use vba code, then a different newsgroup than .programming
would probably have been appropriate.

To get just the row of the active cell, you can use

=ROW(INDIRECT(CELL("address")))

but you'll have to recalculate (F9) in order to have the formula update.
I normally wouldn't use CELL("address") because it will update to the
current active cell address, even if the active cell is on another
worksheet, but perhaps that's what you want.
 
or just:

=CELL("row")


If you can't use vba code, then a different newsgroup than .programming
would probably have been appropriate.

To get just the row of the active cell, you can use

=ROW(INDIRECT(CELL("address")))

but you'll have to recalculate (F9) in order to have the formula update.
I normally wouldn't use CELL("address") because it will update to the
current active cell address, even if the active cell is on another
worksheet, but perhaps that's what you want.

thread said:
Hi thank you for thr quick answer but my issue is that i want to have
a formula that is not a vba code
is it posible
i want the formula inside of the cell to indicate what row is it
JE McGimpsey :
 
Yup. Again, same behavior (need F9, updates on other sheets). May work
for OP...
 
this is the disadvantage that doesnt work for me here,becaouse i want
to use replace function of the windows and place a formula based on
the current cell and the problem is that if i move to another cell,it
will autoticly update all the cells with the current one
any bypass to this problem?

JE McGimpsey :
 

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

Back
Top