Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default Need to determine the ROW of the TARGET in a Worksheet Change Even

How do I determine what row number the TARGET is located in for a
WORKSHEET_Change event. My target MUST be one cell or this piece of the
code won't work.

Can someone assist?

Thanks,
Barb Reinhardt
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Need to determine the ROW of the TARGET in a Worksheet Change Even

how about
if target.address="$A$1" then

--
Don Guillett
SalesAid Software

"Barb Reinhardt" wrote in message
...
How do I determine what row number the TARGET is located in for a
WORKSHEET_Change event. My target MUST be one cell or this piece of the
code won't work.

Can someone assist?

Thanks,
Barb Reinhardt



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default Need to determine the ROW of the TARGET in a Worksheet Change

I'm not sure I made myself clear. I could change a cell anywhere between
D13 and D100 (for example) and I want to know what row # the cell was in.
If I change D20, I want 20 returned. How do I do that?

"Don Guillett" wrote:

how about
if target.address="$A$1" then

--
Don Guillett
SalesAid Software

"Barb Reinhardt" wrote in message
...
How do I determine what row number the TARGET is located in for a
WORKSHEET_Change event. My target MUST be one cell or this piece of the
code won't work.

Can someone assist?

Thanks,
Barb Reinhardt




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Need to determine the ROW of the TARGET in a Worksheet Change

Target is the changed range object:

If Target.Cells.Count 1 Then
Msgbox "More than one cell!"
Exit Sub
End If
myRow = Target.Row
MsgBox "The changed cell was cell " & Target.Address & ", which is row " & myRow


--
HTH,
Bernie
MS Excel MVP


"Barb Reinhardt" wrote in message
...
I'm not sure I made myself clear. I could change a cell anywhere between
D13 and D100 (for example) and I want to know what row # the cell was in.
If I change D20, I want 20 returned. How do I do that?

"Don Guillett" wrote:

how about
if target.address="$A$1" then

--
Don Guillett
SalesAid Software

"Barb Reinhardt" wrote in message
...
How do I determine what row number the TARGET is located in for a
WORKSHEET_Change event. My target MUST be one cell or this piece of the
code won't work.

Can someone assist?

Thanks,
Barb Reinhardt






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Need to determine the ROW of the TARGET in a Worksheet Change

Oh, and if you want to limit when the event is actually used,

Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("D13:D100")) Is Nothing Then Exit Sub
If Target.Cells.Count 1 Then
MsgBox "More than one cell!"
Exit Sub
End If
myRow = Target.Row
MsgBox "The changed cell was cell " & Target.Address & ", which is row " & myRow

End Sub

HTH,
Bernie
MS Excel MVP


"Bernie Deitrick" <deitbe @ consumer dot org wrote in message
...
Target is the changed range object:

If Target.Cells.Count 1 Then
Msgbox "More than one cell!"
Exit Sub
End If
myRow = Target.Row
MsgBox "The changed cell was cell " & Target.Address & ", which is row " & myRow


--
HTH,
Bernie
MS Excel MVP


"Barb Reinhardt" wrote in message
...
I'm not sure I made myself clear. I could change a cell anywhere between
D13 and D100 (for example) and I want to know what row # the cell was in.
If I change D20, I want 20 returned. How do I do that?

"Don Guillett" wrote:

how about
if target.address="$A$1" then

--
Don Guillett
SalesAid Software

"Barb Reinhardt" wrote in message
...
How do I determine what row number the TARGET is located in for a
WORKSHEET_Change event. My target MUST be one cell or this piece of the
code won't work.

Can someone assist?

Thanks,
Barb Reinhardt







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
can 1 excel's DROP target change MULTIPLE cells? Huy Excel Programming 3 July 18th 06 09:04 AM
Using worksheet_change to change value of target cell?? [email protected] Excel Programming 2 June 19th 06 04:59 PM
Excel VBA Target Worksheet change [email protected] Excel Discussion (Misc queries) 1 March 2nd 06 02:33 PM
How do you change code in the VBE without opening the target workb Brett Smith[_2_] Excel Programming 4 January 19th 06 10:10 PM
Worksheet Change Event- Refer to Target Address By Name Jm Excel Programming 2 May 21st 04 02:34 AM


All times are GMT +1. The time now is 03:46 AM.

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"