Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,646
Default Change event

In a
Private Sub Worksheet_Change(ByVal Target As Range)
procedure the Target variables returns the cell just left only if it has
been changed. I need this cell's row number even if it has NOT been changed.
Is there any way?
Thanks Stefi
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Change event

Hi
the nature of this event is that it is only triggered then a change occurs.
Maybe you could describe what you're trying to achieve with this information

"Stefi" wrote:

In a
Private Sub Worksheet_Change(ByVal Target As Range)
procedure the Target variables returns the cell just left only if it has
been changed. I need this cell's row number even if it has NOT been changed.
Is there any way?
Thanks Stefi

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Change event

You would need to use the selectionchange event and store the value in a
static variable:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Static OldTarget As Range
If Not OldTarget Is Nothing Then
MsgBox OldTarget.Row
End If
Set OldTarget = Target
End Sub

OldTarget would be the last cell selected. Depending on what you are doing,
you may need to make that variable public in the sheet module and initialize
with other events - because it will not be initialized on the first
selection by the user.

--
Regards,
Tom Ogilvy

"Stefi" wrote in message
...
In a
Private Sub Worksheet_Change(ByVal Target As Range)
procedure the Target variables returns the cell just left only if it has
been changed. I need this cell's row number even if it has NOT been

changed.
Is there any way?
Thanks Stefi



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Change Cell from Validated List Not Firing Worksheet Change Event [email protected] Excel Programming 3 October 4th 04 03:00 AM
Chart Values that change based on Change event ExcelMonkey[_119_] Excel Programming 1 May 15th 04 03:43 AM
Change minimumscale with the change event of a combobox Herbert Chan Excel Programming 1 April 11th 04 12:43 PM
On change event raj Excel Programming 3 December 10th 03 04:23 AM
change event/after update event?? scrabtree23[_2_] Excel Programming 1 October 20th 03 07:09 PM


All times are GMT +1. The time now is 11:01 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"