ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   SelectionChange event (https://www.excelbanter.com/excel-programming/315029-selectionchange-event.html)

Stefi

SelectionChange event
 
Hi everybody,
In a
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
statement the Target variable contains the VALUE of the target cell. I need
the row number of the target cell. How can I get it?
Stefi


Simon Lloyd[_596_]

SelectionChange event
 

Not sure what you're after because you didn't post your code but instea
of Target.Value try this....Target.Value & Target.Address.

hope this helps

Simo

--
Simon Lloy
-----------------------------------------------------------------------
Simon Lloyd's Profile: http://www.excelforum.com/member.php...nfo&userid=670
View this thread: http://www.excelforum.com/showthread.php?threadid=27315


Tom Ogilvy

SelectionChange event
 
Target is a reference to the cell selected (a range object). Value is the
default attribute/property if you just use the variable target (msgbox
Target, equivalent to msgbox Target.Value). If you want the row use
Target.Row, or for column, Target.column

--
Regards,
Tom Ogilvy


"Stefi" wrote in message
...
Hi everybody,
In a
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
statement the Target variable contains the VALUE of the target cell. I

need
the row number of the target cell. How can I get it?
Stefi





All times are GMT +1. The time now is 11:18 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com