• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

How to Get row Number of the Cells while Seleciting it by Mouse or Arrow keys

sreekhosh

Member
I have a file with 20 names Starting from A1:A20. If i select "A1" (by mouse or cursor) I need to update the row Number of A1 ie "1" in C1.(Like form Control)..
 
Sreekhosh


It might be worth looking at the post Chandoo did last week: http://chandoo.org/wp/2012/07/11/highlight-row-column-of-selected-cell-using-vba/

Download the example file and look at cell E17


You will have to pull the Named Formula and VBA out of the model to suit your purposes
 
Good day sreekhosh


If you put this into a cell it will tell you the last cell you worked on and keeps this information for when you re-open your work book so you will always know where you are in the spreadsheet.


=CELL("address")


This is entered in to a cell, it is not VBA
 
Hi Sreekhosh

In addition to bobhc,

=cell("address"), ** to get only Row Number use =CELL("row")

in each refresh (F9), it display the current cell position.


or if you put the below code in in VBA > Sheet1 > Selection Change, it will refresh the worksheet in each move, (Mouse / Arroe Key)

[pre]
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Calculate
End Sub
[/pre]
Ref # http://chandoo.org/forums/topic/vba-code-to-hightlight-the-current-position-modification#post-30399
 
Back
Top