Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
can 1 excel's DROP target change MULTIPLE cells? | Excel Programming | |||
Using worksheet_change to change value of target cell?? | Excel Programming | |||
Excel VBA Target Worksheet change | Excel Discussion (Misc queries) | |||
How do you change code in the VBE without opening the target workb | Excel Programming | |||
Worksheet Change Event- Refer to Target Address By Name | Excel Programming |