show row number in one fixed cell in reference to your cursor pos.

H

Howard

For example,
key in this formula cell("row") in cell A1
when you move your cursor to Cell B9
cell A1 will display "9" = row 9 where ur cursor being placed at
 
K

Kevin Smith

Hello,

You can use this code in the Sheet Module

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Range("A1").Value = ActiveCell.Row
End Sub
 
J

Jacob Skaria

Right click the sheet tab>View code and paste the below code in the right
code panel. Try selecting cells...

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Application.EnableEvents = False
Range("A1") = Target.Row
Application.EnableEvents = True
End Sub

If this post helps click Yes
 
H

Howard

Thank you so much. it is workable but ss there any other method beside using
macro?

In actual fact, i received one file and in the cell A1, there is one formula
as =cell("row") but i couldn't find any macro created in the file.

When i placed my cursor at cell A115, cell A1 will display 115. I am still
figuring how to do it beside using macro.
 
J

Jacob Skaria

Disable macros. Quit Application and reopen the file and check whether it
works?

If this post helps click Yes
 
G

Gord Dibben

=cell("row") works without VBA code.

If you use it in A1 it will return the row number of the active cell.

Will update only when a calculation takes place.

See help on cell infotype


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